Friday, 10 February 2012

Install nginx on cpanel server

To install nginx , first download nginxadmin and execute following lines :-

# cd /usr/local/src
# wget http://nginxcp.com/latest/nginxadmin.tar
# tar -xvf nginxadmin.tar
# cd publicnginx
# ./nginxinstaller install
# /etc/init.d/httpd restart

Troubleshooting Installation:-

If you receive any pyaml related error or the following error

======================================
Welcome to the Nginx Admin installer……Starting Install
Generating vhosts…
Traceback (most recent call last):
File “/scripts/createvhosts.py”, line 2, in ?
import yaml
File “/usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg/yaml/__init__.py”, line 26
SyntaxError: ‘yield’ not allowed in a ‘try’ block with a ‘finally’ clause
Installing WHM interface…
deploying booster rockets
Traceback (most recent call last):
File “/usr/local/src/publicnginx/nginxinstaller2″, line 9, in ?
import createvhosts
File “/usr/local/src/publicnginx/createvhosts.py”, line 2, in ?
import yaml
File “/usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg/yaml/__init__.py”, line 26
SyntaxError: ‘yield’ not allowed in a ‘try’ block with a ‘finally’ clause
======================================

Then run execute following commands

For i686 architecture :-

# easy_install Pyyaml==3.09
# rm -f /usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg

For x86_64 architecture :-

# easy_install Pyyaml==3.09
# rm -f /usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-x86_64.egg




Then Again run the following commands :-

# ./nginxinstaller install
# /etc/init.d/httpd restart

Now Nginx run on the port no:80 and apache run on the port no.8081.You can manage the nginx through WHM >> Plugins >> Nginx Admin



To uninstall nginx use following :-

#  cd /usr/local/src
#  wget http://nginxcp.com/nginxadmin2.8-stable.tar
#  tar xf nginxadmin2.8-stable.tar
#  cd publicnginx
#  ./nginxinstaller uninstall

No comments:

Post a Comment