Web
Hosting multiple domains on a single domain package
by Tinuva on Nov.05, 2008, under Web
Alright, sometimes you want to host more than one domain, but your package with your webhost only allows 1 domain and however many aliases for this domain.
Lets say your main domain is: mydomain.com
Now the domain you want to host also but dont want to sign up for another hosting package would be:
extradomain.com
Step1:
Set up extradomain.com as an alias of mydomain.com
Step2:
In the main documents folder of mydomain.com (could be public_html or httpdocs or www) you create a folder, ie. “extradomain” and you upload the files for extradomain.com into this folder.
Step3:
Upload a .htaccess file to the main domain’s document folder (again this is public_html/httpdocs/www) with the following content
RewriteEngine on
# Rewrite url for extradomain.com
RewriteCond %{HTTP_HOST} extradomain.com$ [NC]
RewriteCond %{REQUEST_URI} !^/extradomain/.*$
RewriteRule ^(.*)$ extradomain/$1 [L]
Easy as that, and the url wont even change and thus look exactly like a normal hosted domain.
Block IP address only on a specific virtual host
by admin on May.28, 2008, under Linux, Plesk, Web
Yesterday I had a fun request from a client who wants to block 2 specific ip address’s from visiting his site. His reasons was quite real, its bots that are browsing his whole site using too much bandwidth.
Unfortunately for us, his domain is hosted on a shared hosting server with multiple other domains. The problem is this, use iptables to block those ips on the server means they can’t visit any of the other domains and what if there are real users browsing other domains from those ips?
Lucky for us we have mod_security installed on all of our Plesk shared hosting servers. This is a very nice free based application firewall for Apache in the form of a module. It is quite simple, how do you filter specific types of connections to your webserver is port 80 is wide open on the firewall? Hence mod_security.
To block a specific ip address from visiting a specific domain on a shared hosting server you can add the following lines to the seperate config file for that domain or rather the section if you have all your virtual domains in one big config file.
We use mod_security 2.1/2.5 on our servers thus we use SecRule. If you still use mod_security prior to 2.x series you can use the exact same rule and just replace SecRule with SecFilter. On plesk I add this to vhost.conf in /var/www/vhosts/domain/conf/
SecRule REMOTE_ADDR "^71.205.177.169$"
The ^ at the start and the % at the end means only block the specific ip 71.205.177.169, if the rule had a $ at the start and end then the rule would also include the ip 171.205.177.169 so be careful about that.
Wordpress 2.5.1 Upgrade and Spam
by admin on Apr.29, 2008, under Spam, Web
Just upgraded Wordpress to the latest version 2.5.1, it is probably also a good idea for other users out there running their blogs on Wordpress to upgrade.
Lately my blog have been bombarded with spam from bot nets. As with all kinds of spam this become quite a time waster of cleaning up the comment section on each and every post.
It was not more than a day that I found the already installed but disabled Akismet plugin. This plugin uses a central database to monitor comments from Wordpress blogs all over the world and will know immediately know when comments that are posted can be classified as spam. I know this made a world’s difference.