- 08 Feb 2023
- 1 Minute to read
- Print
- DarkLight
Installation of NginxCP on a cPanel server, with tmpfs for nginx cache storage
- Updated on 08 Feb 2023
- 1 Minute to read
- Print
- DarkLight
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 in front of Apache, to cache items such as static HTML, Images, CSS, Javascript. A TMPFS partition is also added, as it allows you toc ache all files in memory for faster access.
Installation:
1. 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.
2. Commence the Nginx Installation
# cd /usr/local/src
# wget http://nginxcp.com/latest/nginxadmin.tar
# tar xf nginxadmin.tar
# cd publicnginx
# ./nginxinstaller install
3. 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
4. Create a limitation on how many files can be stored at once:
# cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig
5. 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;