Installation of NginxCP on a cPanel server, with tmpfs for nginx cache storage
  • 08 Feb 2023
  • 1 Minute to read
  • Dark
    Light

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

  • Dark
    Light

Article summary

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;

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence