| Home Register Memberlist Help Search Quick Links No Replies |
|
||||||
| Basic How-tos Help Us Noobs by Sharing Your Wisdom |
![]() |
![]() |
|
Thread Tools | ![]() |
|
#1
|
||||
|
||||
|
nginx can be used to serve static pages on a server running cPanel with Apache. Apache will handle the dynamic content for PHP and cgi scripts, while nginx will handle the static pages such as .htm and .html
This guide will be using the installer provided in this forum thread Install nginx 1. Make a copy of your httpd.conf file Code:
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak100421 The port on which Apache listens for HTTP connections. Specifying a specific IP will prevent Apache from listening on all other IPs. (default: 0.0.0.0:80) To: 0.0.0.0:8081 Do not change the https port listed. Click the "Save" button. 2. Grab a copy of the nginx installation script: Code:
mkdir /root/cpacct && cd /root/cpacct wget blargman.com/public.tar tar xf public.tar cd publicnginx ./nginxinstaller install Code:
access key doesn't exist create it in WHM At that point, then re-run "./nginxinstaller install" command. 3. Rebuild Apache and then restart nginx and Apache Code:
/scripts/rebuildhttpdconf /etc/init.d/nginx restart /etc/init.d/httpd restart Please note that sites will still show up on port 80 in a browser (so you don't have to worry that pages in a browser will require a different port). nginx works as a proxy on port 80, so it handles the incoming requests on that port to see if they are dynamic or static, then it hands off the dynamic pages to Apache (running on port 8081). Your site visitors will have no idea that Apache is running on a different port due to the proxying nginx performs on the machine for it. ---------------- Uninstall nginx If you decide you want to uninstall nginx at any point, simply run this command: Code:
/root/cpacct/publicnginx/nginxinstaller uninstall The port on which Apache listens for HTTP connections. Specifying a specific IP will prevent Apache from listening on all other IPs. (default: 0.0.0.0:80) To: 0.0.0.0:80 Then "Save" that area. Finally, rebuild and restart Apache: Code:
/scripts/rebuildhttpdconf /etc/init.d/httpd restart
__________________
Miraenda ~ Ex uno disce omnes ~ |
|
#2
|
|||
|
|||
|
Thanks for such great docs But i am having a bit slight problem mkdir /root/cpacct && cd /root/cpacct just as precaution of being hacked(my board was earlier) if i want to change root even that would that work or i have to keep the default root.
__________________
VMWare |
|
#3
|
||||
|
||||
|
You can install it wherever you want for the location. The script itself doesn't just really install in that location, it just puts the files there for the installation to run.
__________________
Miraenda ~ Ex uno disce omnes ~ |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. |
||