Ningx is a great web server, working with static content, it is a great option to serve
If you need to run scripts, like php or perl, you can always send those requirements to Apache, and make Nginx work as a reverse proxy server.
Why Slackware Linux?. Because it is small, stable and fast, I like to have Nginx running on a small VPS alone, and sending script requirement to an Apache server behind, running in another VPS.
If you do not like Slackware, you may also use this guide, but install nginx using your distribution package manager, or also compiling from sources, as I am going to do here.
This article will cover:
- Installing Nginx on Slackware Linux in a VPS server
- Configure Nginx as reverse proxy for Apache Server
* Slackware specific *
If you plan to use Slackware on a VPS, you first need to find a VPS provider that offers Slackware as an option.
I have found Linode (Please follow the link, and help me pay the hosting bill.)
Once you have your Slackware Linux running on the VPS, you will to install the necessary tools to be able to compile Nginx from sources.
Install development tools for Slackware, Now you can download Nginx and proceed.
If you are not on slackware, this may help.
I am going to install Nginx with the gzip-static module option, so I will need
slackpkg install zlib
slackpkg is a slackware package manager, you may try any of this methods to install software on Slackware
Relevant to any distribution and / or hosting
Download the latest stable version of Nginx and save it to your server,
/usr/src/ could be a good place and the one I will be using.
Uncompress the tarbal.
sudo tar xvzf nginx[version].tar.gz
Enter the directory of Nginx
Finally configure and install it on your system
./configure --prefix=/usr / --pid-path=/var/run/nginx.pid \ --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin \ --with-http_ssl_module \ --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log \ --with-http_gzip_static_module
sudo make install
Now that Nginx is installed, we will configure it to serve static content, and pass the PHP to an Apache server.
Now Nginx is configured, now you need to configure the Apache and PHP on the other server. Be sure to configure Apache to listen to 8080.
You may want to read this