Welcome to UltratechHost Forum, Guest. Please take the time to register if you haven't, or click

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[-]
Tags
how to install nginxcp as reverse proxy on cpanel server

cPanel/WHM How to install NginxcP as reverse proxy on cPanel server
#1
If you wish to install nginx as reverse proxy in a cPanel server then, follow this steps:

1. SSH to server as root.
2. Change the directory to “/usr/local/src”

Code:
cd /usr/local/src

Download the latest nginxadmin package & Install


Code:
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar

If you want to change header information then follow these steps:


Code:
cd /usr/local/src/publicnginx/nginx-x.x.x/src/http
vi ngx_http_header_filter_module.c
find nginx admin and change it to MyServer

NginxAdmin Need Remote Key and for Genration:


Code:
Login to WHM > Clusters > Remote Access Key > Generate New Key

Now Lets install Nginxcp:

Code:
cd /usr/local/src/publicnginx
./nginxinstaller install


In WHM, now Nginx Admin plugin will be available under plugins section. After installing make sure Nginx process is running on the server, You can chcek this by using the following command.


Code:
ps aux | grep nginx

If it is not showing any process, then kill httpd and restart httpd


Code:
killall -9 httpd
/etc/init.d/httpd restart

Nginx Admin Uninstall instruction:

Code:
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
./nginxinstaller uninstall


Code:
#crontab -e

At end add
0 */1 * * * /usr/sbin/tmpwatch -am 1 /tmp/nginx_client


Troubleshooting:

1. nginx: [warn] conflicting server name Error:


Code:
cd /etc/nginx/vhosts

perl -pi -w -e 's/server_name(.*) 93.1.2.114/server_name$1/g;' *
/etc/init.d/httpd restart

2. Restarting nginx daemon: nginxnginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)


Code:
cd /etc/nginx/vhosts
sed -i 's/listen \[::\]:80;/#listen \[::\]:80;/g' domain.net
/etc/init.d/httpd restart

Or


Code:
cd /etc/nginx/vhosts
grep -r listen .
find ./ -type f -print0 | xargs -0 sed -i 's/listen \[::\]:80;/#listen \[::\]:80;/g'
/etc/init.d/httpd restart

Or

Disable IPv6 Permanently ( Using this we wont face any issue with new domain creation)


Code:
vi /etc/sysctl.conf

at end add

Code:
#Disable IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

Then run sysctl -p and reboot



Dinesh Kumar Mohanty
Ultra Web Solutions®
Bhubaneswar, Odisha, India.

UltratechHost - Your One Stop Offshore & Onshore Hosting Provider
Server Locations : Netherlands, Germany, Russia, Singapore & USA
Service Offers: Shared hosting | Reseller hosting | Cloud server | Dedicated server | VPS Hosting



Forum Jump:


Users browsing this thread: 1 Guest(s)