Installation of NginxCP on a cPanel server, with tmpfs for nginx cache storage


NOTE: This Article is aimed towards advanced Users. While it may look simple, Nginx can be a complex item to manage, as can available resources on your service.

If you need assistance, please don't hesitate in contacting our support team.

Below is aimed at Installing NginxCP, which is a reverse-proxy, which is placed infront of Apache, to cache items such as static HTML, Images, CSS, Javascript. A TMPFS partition is also added, as it allows you to cache all files in memory for faster access.


Prior to Installation. Check for a file called /root/.accesshash. 

If it doesn't exist Login to WHM on the server, and navigate to "Main >> Cluster/Remote Access >> Setup Remote Access Key", and Generate a new Key.

Commence the Nginx Installation
# cd /usr/local/src
# wget
# tar xf nginxadmin.tar
# cd publicnginx
# ./nginxinstaller install

Create a TMPFS system to store the Nginx Cache Files. 512M is an example used here, for a 4GB RAM Virtual Machine.
# echo "tmpfs /tmp/nginx_client tmpfs size=512M,noexec,nosuid,nodev,noatime,noauto 0 0" >> /etc/fstab
# rm -Rf /tmp/nginx_client/*
# mount -a

Create limitation on how much files can be stored at once.
# cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig

Add the following line, within the http { } section in /etc/nginx/nginx.conf. The Amount below, should be slightly less than the full volume allowed for the TMPFS created above.
proxy_max_temp_file_size 500M;

Have more questions? Submit a request