The following script is using blogama.org IP geolocation API to automatically generate Apache .htaccess file to deny or allow specific countries. You can put this script under crontab and the .htaccess rules will be automatically updated. Also, it can update multiple .htaccess files.
Source: http://blogama.org
Deny or allow?
First you need to understand the meaning of these two rules in the .htaccess file. If you set "deny" in the script for countries "US,CA" (USA and Canada), all traffic from USA or Canada will be blocked. On the other hand, if you set "allow" it will only accept traffic from these two countries, all others being blocked.
Countries code
You need to know the ISO country code you want to deny/allow. The list is available here.
Usage without the automated script
Go to:
http://blogama.org/country_query.php?country=CA,US&output=htaccess_deny
Where country is the list or countries, with a comma between them and output is either htaccess_deny or htaccess_allow.
How is the script working?
You will have to create a text file with all .htaccess files (with complete path) you wish to update with the script. If you have other information in your .htaccess files they will still remain there, the script will only update the portion between the tags "#COUNTRY_BLOCK_START" and "#COUNTRY_BLOCK_END".
Before you start with the script
Create a text file named htaccessfile.txt (in the WORKDIR of the script, see below). In that file, put all (existing!) .htaccess files you wish to update. For example:
More White Papers
/var/www/example.com/.htaccess
/var/www/mydomain.com/.htaccess
Script configuration
On top of the script, you will find this section. You need to modify these variables if needed:
###MODIFY THIS SECTION###
WORKDIR="/root/"
HTACCESSFILE="htaccessfile.txt"
HTACCESSBLOCK="htaccess-blocklist.txt"
TEMPFILE="htaccess.temp"
COUNTRIES="US,CA"
TYPE="allow"
#########################
WORKDIR: is a writable directory where the script will be located.
HTACCESSFILE: is the file where you will put your .htaccess paths.
HTACCESSBLOCK and TEMPFILE: are temporary file that will be deleted at the end of the script execution.
COUNTRIES: is the list of countries you wish to deny/allow, separated with a comma.
TYPE: "allow" or "deny" access to these countries.
The script
#!/bin/bash
###BLOGAMA.ORG###
###MODIFY THIS SECTION###
WORKDIR="/root/"
HTACCESSFILE="htaccessfile.txt"
HTACCESSBLOCK="htaccess-blocklist.txt"
TEMPFILE="htaccess.temp"
COUNTRIES="US,CA"
TYPE="deny"
#########################
#####DO NOT MAKE MODIFICATIONS BELOW#####
cd $WORKDIR
#Get the file from blogama.org API
wget -c --output-document=$HTACCESSBLOCK "http://blogama.org/country_query.php?country=$COUNTRIES&output=htaccess_$TYPE"
for i in $( cat $WORKDIR$HTACCESSFILE ); do
if [ -f $i ]; then
cat $i 2>&1 | grep "COUNTRY_BLOCK_START"
if [ "$?" -ne "1" ]; then #ALREADY IN HTACCESS
sed '/#COUNTRY_BLOCK_START/,/#COUNTRY_BLOCK_END/d' $i > $WORKDIR$TEMPFILE
cat $WORKDIR$HTACCESSBLOCK >> $WORKDIR$TEMPFILE
mv $WORKDIR$TEMPFILE $i
else #NOT IN HTACCESS
cat $WORKDIR$HTACCESSBLOCK >> $i
fi
fi
done
rm -f $WORKDIR$HTACCESSBLOCK
Make it executable:
chmod +x whatever_you_called_this_script
Add it to your crontab:
* * * * * /path/to/whatever_you_called_this_script >/dev/null 2>&1
Note: Use this script at your own risk. If you find any bug or see something that doesn't work as it should, please post it in the forums at Blogama.org forums.
http://www.howtoforge.com/deny-or-allow-countries-with-apache-htaccess
Blocked Counteries with their ISO
http://ipinfodb.com/country_query.php?country=AF,AR,BG,BR,CN,CZ,EE,HK,KP,KR,MD,RO,RU,TR,UZ,LV,UA&output=htaccess_deny
Dienstag, 1. September 2009
Samstag, 29. August 2009
Blocking IP Addresses Of Any Country With iptables
The API to get the IP addresses to block
First you need to know the code (ISO 3166 format) of the country you would like to block. The full list is available HERE ("http://www.blogama.org/country.txt").
Once you have the country code, you can now get the list at the following url (Afghanistan and Argentina in this example):
http://blogama.org/country_query.php?country=AF,AR
If you dont see IP addresses by lines, view the page code.
http://www.howtoforge.com/blocking-ip-addresses-of-any-country-with-iptables
---------------------
Q. How do I block an IP address or subnet under Linux operating system?
A. In order to block an IP on your Linux server you need to use iptables tools (administration tool for IPv4 packet filtering and NAT) and netfilter firewall. First you need to log into shell as root user. To block IP address you need to type iptables command as follows:
Syntax to block an IP address under Linux
iptables -A INPUT -s IP-ADDRESS -j DROP
Replace IP-ADDRESS with actual IP address. For example if you wish to block ip address 65.55.44.100 for whatever reason then type command as follows:
# iptables -A INPUT -s 65.55.44.100 -j DROP
If you have IP tables firewall script, add above rule to your script.
If you just want to block access to one port from an ip 65.55.44.100 to port 25 then type command:
# iptables -A INPUT -s 65.55.44.100 -p tcp --destination-port 25 -j DROP
The above rule will drop all packets coming from IP 65.55.44.100 to port mail server port 25.
http://www.cyberciti.biz/faq/how-do-i-block-an-ip-on-my-linux-server/
First you need to know the code (ISO 3166 format) of the country you would like to block. The full list is available HERE ("http://www.blogama.org/country.txt").
Once you have the country code, you can now get the list at the following url (Afghanistan and Argentina in this example):
http://blogama.org/country_query.php?country=AF,AR
If you dont see IP addresses by lines, view the page code.
http://www.howtoforge.com/blocking-ip-addresses-of-any-country-with-iptables
---------------------
Q. How do I block an IP address or subnet under Linux operating system?
A. In order to block an IP on your Linux server you need to use iptables tools (administration tool for IPv4 packet filtering and NAT) and netfilter firewall. First you need to log into shell as root user. To block IP address you need to type iptables command as follows:
Syntax to block an IP address under Linux
iptables -A INPUT -s IP-ADDRESS -j DROP
Replace IP-ADDRESS with actual IP address. For example if you wish to block ip address 65.55.44.100 for whatever reason then type command as follows:
# iptables -A INPUT -s 65.55.44.100 -j DROP
If you have IP tables firewall script, add above rule to your script.
If you just want to block access to one port from an ip 65.55.44.100 to port 25 then type command:
# iptables -A INPUT -s 65.55.44.100 -p tcp --destination-port 25 -j DROP
The above rule will drop all packets coming from IP 65.55.44.100 to port mail server port 25.
http://www.cyberciti.biz/faq/how-do-i-block-an-ip-on-my-linux-server/
Freitag, 28. August 2009
Block Country.com
How to block ip address from certain country.
1. go to blockcoutnry.com
2. choose the coutnry
3. generate the ip address of the country
4. copy and paste in .htaccess file
4.1. paste after the heading of the file
order allow,deny
allow from all
4.2. delete
order allow,deny
and
5. go to the server and back up .htaccess to .htaccessess
6. upload from computer the .htaccess to the server
7. you will find the .htaccess under
public_html.
8. go to ip deny manager you should find all your new blocked ip addressess
http://www.blockacountry.com/
1. go to blockcoutnry.com
2. choose the coutnry
3. generate the ip address of the country
4. copy and paste in .htaccess file
4.1. paste after the heading of the file
order allow,deny
allow from all
4.2. delete
order allow,deny
and
5. go to the server and back up .htaccess to .htaccessess
6. upload from computer the .htaccess to the server
7. you will find the .htaccess under
public_html.
8. go to ip deny manager you should find all your new blocked ip addressess
http://www.blockacountry.com/
Donnerstag, 27. August 2009
phpBB: Count Click
PowWowPalace wrote:I install this mod today on phpbb 3.0.5 with no problems. I can't seem to get the click count to work. Excellent mod otherwise.
Place your count click as follows. (note it seems not to work with some affiliate links)
Code: Select all
{COUNT_CLICK} href="http://www.whicheversite.com">
I use a center code also and a target blank i just removed them but they can be added. http://www.phpbb.com/community/viewtopic.php?f=69&t=1146135&start=720
Place your count click as follows. (note it seems not to work with some affiliate links)
Code: Select all
{COUNT_CLICK} href="http://www.whicheversite.com">
I use a center code also and a target blank i just removed them but they can be added. http://www.phpbb.com/community/viewtopic.php?f=69&t=1146135&start=720
I would love to change that phpBB logo
Re: How to change phpbb logo...
Postby Kevin Clark » Sat Nov 08, 2008 12:19 pm
Make your new logo file and save it as a gif, jpg or png file.
Upload it to your forum/styles/stylename/imagesets folder
Open
imageset/imageset.cfg
Find
Code: Select all
img_site_logo = site_logo.gif*52*139
and edit the logo name and dimensions accordingly.
Admin panel>styles>imagesets>refresh
Then hold shift and refresh your forum index.
http://www.phpbb.com/community/viewtopic.php?f=74&t=1284695
Postby Kevin Clark » Sat Nov 08, 2008 12:19 pm
Make your new logo file and save it as a gif, jpg or png file.
Upload it to your forum/styles/stylename/imagesets folder
Open
imageset/imageset.cfg
Find
Code: Select all
img_site_logo = site_logo.gif*52*139
and edit the logo name and dimensions accordingly.
Admin panel>styles>imagesets>refresh
Then hold shift and refresh your forum index.
http://www.phpbb.com/community/viewtopic.php?f=74&t=1284695
Absolute and Relative File Paths
As simple example from my forum:
http://forum.classicremedy.com/
the image is in
/public_html/forum/classicRemedy/images/ads/
the path start with /public_html/ not /home1/mareifam/
to get to the images type
----------------------------------
When you embed an image or a link in a webpage, you can use an absolute path or a relative path in your HTML syntax.
Absolute Path
These are absolute server paths, they are relative in regards to your http document directory:
/flowers.html
/inventory/flowers.html
This absolute path is relative in regards to the world wide web:
http://yourdomain.net/flowers.html
Relative Path
The following example is relative to a file residing in the same directory:
vases.html
This relative path points to a file one directory back:
../vases.html
More Examples:
The absolute path to the main page of a typical website would be:
http://yourdomain.com/index.html
A page residing in http://yourdomain.com/inventory/flowers.html that links to your home page would use one of these absolute paths:
http://yourdomain.com/index.html
/index.html
/
The last two examples are absolute server paths, you may think of the first forward slash in these paths as representing your domain.
Note: Your main page must be named "index" but may bear any of the following file extensions: index.shtml, index.htm, index.html, index.shtm, index.php, index.cgi..., in each case using the absolute server path : / would send you to the home page.
If your html file is in /homes/redhome.html and your image file is in /images/redhome.jpg you can embed the image into the page redhome.html using an absolute path to the file:
A relative path to the same file would be:
With an absolute path, it doesn't matter where the html file calling the other file resides.
You may place redhome.html in: /pages/redhome.html and embed the image as:
With a relative path, if you place redhome.html in: /pages/redhome.html, and embed the image as:
(a relative path)
then your image file will not load. This is because redhome.html is looking for /pages/images/redhome.jpg, which does not exist.
Paths used in links work in the same manner as those used in images. For example, imagine redhome.html is in /homes/redhome.html, and it contains a relative link to bluehome.html. This link would appear as:
If you move your redhome.html file to some other directory within your website then the link will no longer work. This is because, by asking for a file via a relative link, you are telling the user agent, the browser, that the file you have created a link to is located within the same directory as that of the calling file.
Problems Using Absolute Paths with SSL
If you are borrowing use of an SSL certificate, such as the one provided free of charge to Internet Connection customers, when a webpage changes from http protocol to https (SSL), if you embed any images by absolute paths without domain names (/images/o.jpg), they will be broken.
If you embed images with full URL absolute paths (http://yourdomain.com/images/o.jpg), the images will show up, but the user will get warning messages that the page is a mix between secure and non-secure items.
On web pages that make transitions between http and https, one should use relative paths to avoid these problems.
http://support.internetconnection.net/TECHNICAL_REFERENCE/THE_WWW/Absolute_and_Relative_File_Paths.shtml
http://forum.classicremedy.com/
the image is in
/public_html/forum/classicRemedy/images/ads/
the path start with /public_html/ not /home1/mareifam/
to get to the images type
----------------------------------
When you embed an image or a link in a webpage, you can use an absolute path or a relative path in your HTML syntax.
Absolute Path
These are absolute server paths, they are relative in regards to your http document directory:
/flowers.html
/inventory/flowers.html
This absolute path is relative in regards to the world wide web:
http://yourdomain.net/flowers.html
Relative Path
The following example is relative to a file residing in the same directory:
vases.html
This relative path points to a file one directory back:
../vases.html
More Examples:
The absolute path to the main page of a typical website would be:
http://yourdomain.com/index.html
A page residing in http://yourdomain.com/inventory/flowers.html that links to your home page would use one of these absolute paths:
http://yourdomain.com/index.html
/index.html
/
The last two examples are absolute server paths, you may think of the first forward slash in these paths as representing your domain.
Note: Your main page must be named "index" but may bear any of the following file extensions: index.shtml, index.htm, index.html, index.shtm, index.php, index.cgi..., in each case using the absolute server path : / would send you to the home page.
If your html file is in /homes/redhome.html and your image file is in /images/redhome.jpg you can embed the image into the page redhome.html using an absolute path to the file:
A relative path to the same file would be:
With an absolute path, it doesn't matter where the html file calling the other file resides.
You may place redhome.html in: /pages/redhome.html and embed the image as:
With a relative path, if you place redhome.html in: /pages/redhome.html, and embed the image as:
(a relative path)
then your image file will not load. This is because redhome.html is looking for /pages/images/redhome.jpg, which does not exist.
Paths used in links work in the same manner as those used in images. For example, imagine redhome.html is in /homes/redhome.html, and it contains a relative link to bluehome.html. This link would appear as:
If you move your redhome.html file to some other directory within your website then the link will no longer work. This is because, by asking for a file via a relative link, you are telling the user agent, the browser, that the file you have created a link to is located within the same directory as that of the calling file.
Problems Using Absolute Paths with SSL
If you are borrowing use of an SSL certificate, such as the one provided free of charge to Internet Connection customers, when a webpage changes from http protocol to https (SSL), if you embed any images by absolute paths without domain names (/images/o.jpg), they will be broken.
If you embed images with full URL absolute paths (http://yourdomain.com/images/o.jpg), the images will show up, but the user will get warning messages that the page is a mix between secure and non-secure items.
On web pages that make transitions between http and https, one should use relative paths to avoid these problems.
http://support.internetconnection.net/TECHNICAL_REFERENCE/THE_WWW/Absolute_and_Relative_File_Paths.shtml
Dienstag, 11. August 2009
Joomla: Change Site Title
--------------------
I am very new to Joomla but I had a similar questions recently and a web designer helped and said to do this:
Title change for the homepage: Menus >> Menu Manager >> Top Menu >> Home >> Parameters System (RHS) >> Page Title
That helped me change my Home page title. Hope it works for you too.
http://forum.joomla.org/viewtopic.php?f=544&t=417489&view=next
Abonnieren
Posts (Atom)