CPanelNginx
From Sysvm VEPH : VPS Control Panel
About cPanelNginx
cPanelNginx is an Nginx integration plugin for cPanel server for increasing server speed , performance and protection.
Requirements:
You need a cPanel server running latest stable release of cPanel with apache version 2.2 . Make sure curl module and ioncube loader is enabled in server php ( If you are using freeBSD, this plugin is not tested for it).You need the following php settings.
- Suhosin disabled
- safe_mod= Off
- Ioncube enabled
- openbase_dir= Off ( if enabled )
- exec() and system() enabled
You can enable this after installation of cPnginx
Install cPanel Nginx
Downlaod the latest cpanelnginx from https://portal.syslint.com/downloads.php . The file will be in a gtar format with a name like cpanelnginx.X.Y.tar.gz , where X.Y is the version . Now upload this to your server and install it as follows
# tar -xzf cpanelnginx.X.Y # cd cpanelnginx/ # sh install.sh
Configure cPanelNginx
You can configure your Nginx sever from WHM -> Plugins -> cPanel Nginx .
Uninstall cPanelNginx
To remove the cPanelNginx Plugin execute the script as follows,
# sh /etc/cpnginx/uninstall.sh
Technical Support Please consider opening a support request from https://portal.syslint.com/
Add custom file extensions to Nginx server
From the version 2.0 it is possible to add custom file extensions to add directly to nginx server. So that those files will be directly served from nginx. To do this please go to WHM -> Plugins -> cPanel Nginx -> Edit File Extensions.
How to disable/enable nginx temperately
To disable nginx run the script /scripts/disablenginx .This will disable nginx server and switch apache to port 80 To enable a disabled nginx server run the script /scripts/enablenginx , this will enable nginx on port 80
Enable 301 redirect , password protected folders , other big .htaccess url rewrites.
This option is available from version 3.0 . To enable this option for a domain go to WHM -> Plugins -> cPanel Nginx -> Direct Push and enable / disable it for domains.
How to set Custom expire time ( New feature from version 5.0 )
You may go to WHM -> Plugins -> cPanel Nginx -> Set Expire Time . Then chose the domain and set the value. You can also set it from the server shell too. See and example below.
echo "30d" > /etc/cpnginx/expires/foo.com
How to include custom configuration file for a domain ( New feature from version 5.0 )
You may need to place the custom include file in /etc/cpnginx/custom/ . Then rebuild nginx vhost and restart . The syntax of custom include file must be /etc/cpnginx/custom/domain.com . Please see an example below for the domain foo.com
cat >> /etc/cpnginx/custom/foo.com <<EOF
# Hot link protection for domain foo.com
location ~ \.(jpg|jpeg|bmp|jif|bmp|gif|png)$ {
root /home/foo/public_html/;
valid_referers server_names none blocked;
if ($invalid_referer) {
return 403;
}
}
EOF
