Now every server owner at Sangkrit.net can easily accelerate his websites by caching both static and dynamic content to reduce the load on the servers.
So if you buy any Linux-based VPS or Dedicated Server, you can enable caching for yourself and also your clients by providing a caching button on every hosting account you make on your server. You and your users can simply turn this button on to turn on catching, no other configuration is required.
Follow these steps:
- Login to your SANGKRIT.net account
- Visit your ‘My Products’ page
- Click the ‘Servers’ option
- Next to ‘Server Actions’ click ‘Launch WHM’
- Open ‘Nginx Manager’ from the software section menu on the left
- You can now enable the caching
The page allows you to enable the caching on any or all hosting accounts running on your server You can also enable cache by default for all hosting accounts or click the ‘User Settings’ tab to enable NGINX caching selectively on accounts. It also provides you the option to selectively or collectively delete your server’s cache.
Every cPanel user account created by you on your VPS or Dedicated Server will also provide an option to enable caching over the websites running on that hosting account.
On an Nginx server, it is possible for you to configure it to manage both HTTP and HTTPS requests.
You should also know that prior to 0.7.14, it was not possible to enable SSL certificate selectively over individual listening sockets, as we have done here in the following given code:
listen 443 ssl;
Before SSL could only be enabled over the entire server using an SSL directive, thus it was impossible to put up a single HTTP/HTTPS server. Afterward, the SSL parameter of the listen directive was added to resolve this problem.
The use of the SSL directive in newer versions has been discouraged.
In SSL protocol conduct, a typical problem occurs when two or more configured HTTPS servers listen on a single IP address.
listen 443 ssl;
listen 443 ssl;
As shown above, what exactly happens here is that the client browser starts to receive the default server’s certificate (www.yoursite.com) regardless of the name of the server requested.
This is pushed by SSL protocol conduct. Here, the connection via SSL is made before the browser sends another HTTP request and Nginx does not know the server name requested. Hence, it may only offer the default server’s certificate.
Here’s the solution:
listen 192.168.1.1:443 ssl;
listen 192.168.1.2:443 ssl;
Above given is the ancientest and most powerful way used for resolving this issue. Here a separate IP address is assigned for each HTTPS server.
You need to update the config file on your server to use the SSL certificate you are subscribed to. This can be done by accessing the command line SSH and opening the Nginx config file for the domain you are installing the SSL certificate.
Simply run the following command:
sudo vim /etc/nginx/sites-available/yourwebsite.com
Now update the config file to use the SSL certificate:
return 301 https://$host$request_uri;
listen 443 ssl;
index index.php index.html index.htm;
The next step is to save the file using this command:
And then restart your Nginx server with this command:
sudo service nginx restart
In the previous lesson, you learned about installing and configuring Nginx on your dedicated server. Now this lesson is on installing SSL and other standard certificates.
The first thing you need to do is get an SSL certificate from Sangkrit.net, once you subscribe to it and your certificate request is approved just download it to install those files on your dedicated server.
To download and install your certificate files follow these steps:
- Visit your Sangkrit.net product page
- Select SSL Certificates
- Select Manage next to the certificate you need to download
- Select a Server type
- Click the Download Zip File option
- Your certificate would start downloading now.
- Copy the SSL certificate file and the certificate bundle file to the Nginx server
- You already have a key file on the server which you got when you generated your certificate request.
- Now edit your Nginx configuration to reference these files
Your certificate is installed now. Remember, the actual configuration file you edit depends on your version of Nginx, your OS platform, or the method you are using to install Nginx.
Nginx is a web server that is also used as a reverse proxy option. It also balances the load on your dedicated server and acts as a mail proxy as well as an HTTP cache. It is software used for high performance on your server.
This lesson will guide you in installing and configuring Nginx and for that, you are going to need the root privileges. You will also require to set up your CentOS server to use the EPEL Repository which stands for Extra Packages for Enterprise Linux.
To install EPEL simply run this command:
sudo yum install epel-release
You can read more about its configuration steps here. Earlier we installed yum as a package manager but it does not include any new version of Nginx in its default repository so installing EPEL will make sure that Nginx on CentOS remains up to date.
You are ready to install Nginx
Now you are ready to install Nginx on your server, simply run the following command:
sudo yum install nginx
Next, start Nginx:
Nginx doesn’t start on its own, so you will need to run a command for starting Nginx on your server:
sudo /etc/init.d/nginx start
To make sure Nginx is properly installed on your server, just direct your browser to your server’s IP address. If you see the words, “Welcome to Nginx”, it means you have Nginx installed and working.