Nginx is a open source powerful web server which can handle millions of visitors. Nginx setup in reverse will boost up cPanel/WHM Server. cPanel does not officially support nginx yet but we can set up nginx on cPanel using NginxCP installation script , which provide good performance with cPanel Servers because
Benefits of Nginx on cPanel & WHM :
- Boost up server performance with Gzip compression.
- Plugin Integrated with cPanel/WHM Service Monitor.
- Nginx Admin help to manage Nginx directly from WHM .
- Support of PHP Rewrite .
- Selection of service Nginx or Apache on domain basis.
- Nginx pass trusted web requests , this will protect from common attacks .
Steps to install Nginx Admin :
Access the server through SSH with root account and get terminal command line and go into the directory through below command .
Download nginxadmin package through below command .
Extract the nginxadmin.tar in the same path .
tar xf nginxadmin.tar
After extract the publicnginx folder will be create in the same path and go to this directory.
Now run the nginx installer through below command.
If you got the error like “access key doesn’t exist,” then you need to create access key on cPanel / WHM Server , Follow below steps to configure access key through Control panel through WHM Login.
Home >> Clusters >> Remote Access Key >> Generate New Key
After Generate New key , now you can run again installer as above.
Now after successful run the installer script , the output will be look like below.
Welcome to the Nginx Admin installer......Starting Install Please Wait ....... Generating vhosts... Installing WHM interface... … … **************************************************** * Installation Complete * *run /etc/init.d/httpd restart to start Nginx Admin* ****************************************************
Restart nginx with apache service .
For CentOS 7 , RHEL 7 or Cloud Linux 7 version :
systemctl restart httpd
Here i have run the status of httpd , i have got below output of the status of apache.
[email protected] [~]# systemctl status httpd ● httpd.service - Apache webserver managed by cPanel EasyApache Loaded: loaded (/etc/systemd/system/httpd.service; enabled; vendor preset: di sabled) Active: active (running) since Mon 2016-02-01 09:45:21 UTC; 4min 20s ago Process: 32541 ExecStart=/usr/local/cpanel/scripts/restartsrv_httpd --no-verbo se (code=exited, status=0/SUCCESS) Main PID: 26203 (code=exited, status=0/SUCCESS) CGroup: /system.slice/httpd.service ├─32551 /usr/local/apache/bin/httpd -k start ├─32554 nginx: master process /usr/local/sbin/nginx -c /etc/nginx/... ├─32555 nginx: worker process ├─32556 nginx: worker process ├─32557 nginx: worker process ├─32558 nginx: worker process ├─32559 nginx: cache manager process ├─32561 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/bin/... ├─32562 /usr/local/apache/bin/httpd -k start ├─32563 /usr/local/apache/bin/httpd -k start ├─32564 /usr/local/apache/bin/httpd -k start ├─32565 /usr/local/apache/bin/httpd -k start └─32566 /usr/local/apache/bin/httpd -k start Feb 01 09:45:20 server.XXXXX systemd: Starting Apache webserver manage.... Feb 01 09:45:21 server.XXXXX restartsrv_httpd: Starting nginx daemo... Feb 01 09:45:21 server.XXXXX systemd: Started Apache webserver managed.... Hint: Some lines were ellipsized, use -l to show in full.
For CentOS , RHEL 5,6 version :
After installation you can check and manage Nginx Admin plugin . You can restart Nginx as well check login and configuration file from there.
2 comments on “Installing Nginx on cPanel / WHM Server”
ornithosisJune 4, 2017 at 1:20 am
I’m as you could probably teach a class concerning how to produce
a great blog. This is fantastic! I need to say, what really got me was your
design. You understand how to make your blog not just a rant about an issue.
Youve made it possible for individuals to connect.
Healthy, because not too many individuals know what
AriadneFebruary 22, 2021 at 3:16 pm
This process certainly helped me a lot. Easy to do.