Difference between revisions of "Nginx"

From vpsget wiki
Jump to: navigation, search
(Created page with "<p>How to install nginx on Centos.</p> Add nginx repo first. To add it, create the file /etc/yum.repos.d/nginx.repo with you favorite text editor, for example: nano /etc/yum....")
 
Line 10: Line 10:
 
Now you can install nginx with a simple command:
 
Now you can install nginx with a simple command:
 
  yum install nginx
 
  yum install nginx
To start nginx, type:
+
To start nginx and allow it to start at boot:, type:
 
  service nginx start
 
  service nginx start
 +
chkconfig nginx on
 
If nginx doesn't start, make sure you haven't httpd service running and listening the same port (80). You can display running services with the command:
 
If nginx doesn't start, make sure you haven't httpd service running and listening the same port (80). You can display running services with the command:
 
  top
 
  top
 
If you want to turn off httpd and disable it to start at boot, enter:
 
If you want to turn off httpd and disable it to start at boot, enter:
 +
service httpd stop
 +
chkconfig httpd off

Revision as of 10:47, 3 September 2013

How to install nginx on Centos.

Add nginx repo first. To add it, create the file /etc/yum.repos.d/nginx.repo with you favorite text editor, for example:

nano /etc/yum.repos.d/nginx.repo

Then insert the strings below and save the file:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

Now you can install nginx with a simple command:

yum install nginx

To start nginx and allow it to start at boot:, type:

service nginx start
chkconfig nginx on

If nginx doesn't start, make sure you haven't httpd service running and listening the same port (80). You can display running services with the command:

top

If you want to turn off httpd and disable it to start at boot, enter:

service httpd stop
chkconfig httpd off