Installing nginx on CentOS / Fedora - VPS

Installing this ultrafast web server into your QuickWeb VPS is quite easy, just follow this step by step instructions below:

To install Nginx using yum we will need to include the EPEL repository.

Let's begin by installing the EPEL repository:

sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/

x86_64/epel-release-5-4.noarch.rpm

Now, Install nginx using Yum :)

sudo yum install nginx

As this will be the first package we install using EPEL, we will be asked to import the EPEL

gpg-key. This key is used to sign all packages that are associated with the EPEL repository

to verify their validity. Once the gpg-key has been imported, the installation should

proceed as expected. This will install any dependencies that Nginx requires.



Thats it! Start Nginx

sudo /etc/init.d/nginx start

Now simply navigate to your IP address. You can get the IP address of the server by issuing

the below command

hostname -i

 

Confirm the successful installation by accessing the server IP address in the browser and you will see the following welcome screen:

 

As you would imagine when installing an application with the yum package manager, all init scripts have been

created.

However, we need to set up Nginx to start automatically if the slice is rebooted:

sudo /sbin/chkconfig nginx on


Controlling nginx is done with these commands:

sudo /etc/init.d/nginx start

sudo /etc/init.d/nginx stop

sudo /etc/init.d/nginx reload

sudo /etc/init.d/nginx restart


You can also check the current status as well as the configuration syntax by using the following commands:

sudo /etc/init.d/nginx status

sudo /etc/init.d/nginx configtest


The configtest option is particularly useful for testing your Nginx configuration before actually implementing it with

a reload or restart.

That's it.

  • 3 Users Found This Useful
Was this answer helpful?

Related Articles

Connecting to your VPS via VNC

This knowledge base article will explain how you can connect to your VNC enabled Linux VPS....

How to set reverse DNS (rDNS)

At the moment you need to open a Helpdesk ticket and provide your IP and PTR record you want set,...

My SSH shows "-bash-*". How to change?

When a Xen VPS is delivered and you login for the first time you might see something similar to...

Installing OpenVPN on OpenVZ VPS (CentOS)

You must enable tun/tap and or PPP directly from inside VPS Manager under "settings" tab. then...

How to add website via webmin

This is a great tutorial how you can add new domain/website using webmin....