Web Development

Another server to deploy your web pages

Apache vs nginx

In a process-based server, each simultaneous connection requires a thread which incurs significant overhead. An asynchronous server, on the other hand, is event-driven and handles requests in a single (or at least, very few) threads. Apache is a process-based server, while nginx is an event-based web server. The main advantages of Nginx over Apache are performance and efficiency.

Installing Nginx

Step One—Install nginx

In the terminal type in:

sudo apt-get install nginx

When prompted, say yes. nginx is now installed on your virtual private server.

Step Two—Start nginx

sudo service nginx start

Step Three—RESULTS: Confirm That nginx Has Started

You can confirm that nginx has been installed as your web server by directing your browser to your IP address.

You can run the following command to reveal your virtual server’s IP address.

ifconfig eth0 | grep inet | awk '{ print $2 }'

When you visit your IP address page in your browser, you will see the words, “Welcome to nginx”