Tuesday, February 15, 2011

mod_wsgi setup

Installing mod_wsgi

For the installation of mod_wsgi first you need to install mysql-python

"yum install python26-devel"

By using the easyapache script you can install this module on your cpanel servers. Basically if you run easyapache script this module is not on the list. To make list this module on your easyapache script you need execute the following command

wget http://easyapache.cpanel.net/optmods/$NAME.tar.gz
tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf $NAME.tar.gz

Here it is

tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf ModWSGI.tar.gz

You can find all the custom module on http://docs.cpanel.net/twiki/bin/view/EasyApache3/CustomMods

Once you do this then mod_wsgi will be list on your easyapache script

Friday, February 4, 2011

redirection

Using .htaccess we can do the redirection

Regular Expression:-
. (full stop) - match any character
* (asterix) - match zero or more of the previous symbol
+ (plus) - match one or more of the previous symbol
? (question) - match zero or one of the previous symbol
\? (backslash-something) - match special characters
^ (caret) - match the start of a string
$ (dollar) - match the end of a string

redirect abc.com to abc.com/blog/
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.abc.com$
RewriteRule ^/?$ "http\:\/\/www\.abc\.com\/blog" [R=301,L]

redirecting abc.com/def.com to xyz.com[ie primarydomain.com/addondomain.com to anotherdomain/any]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc\.com\/def\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.abc.com\/def\.com$ [OR]
RewriteRule ^/?$ "http\:\/\/www\.xyz\.com\/404.php" [R=301,L]


Redirecting parked domain to another website
RewriteEngine on
RewriteCond %{HTTP_HOST} ^parkedomain.com$
RewriteRule ^(.*)$ http://anydomain.com/$1 [R=301]

OR
RewriteCond %{HTTP_HOST} ^parkeddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.parkeddomain.com$
RewriteRule ^/?$ "http\:\/\/www\.otherdomain\.com" [R=301,L]