RHEL / Centos 6: Install Nginx Using Yum Command

标签: nginx for redhatRHEL nginx
1262人阅读 评论(0) 收藏 举报
分类:

RHEL v6.x user type the following command:
# wget http://nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm
# rpm -ivh nginx-release-rhel-6-0.el6.ngx.noarch.rpm

Sample outputs:

warning: nginx-release-rhel-6-0.el6.ngx.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY
Preparing...                ########################################### [100%]
   1:nginx-release-rhel     ########################################### [100%]

Step #2: Install nginx web-server

Type the following yum command to install nginx web-server:
# yum install nginx


Step #3: Turn on nginx service

Type the following command:
# chkconfig nginx on

How do I start / stop / restart nginx web-server?

Type the following commands:
# service nginx start
# service nginx stop
# service nginx restart
# service nginx status
# service nginx reload


Step #4: Configuration files

  1. Default configuration directory: /etc/nginx/
  2. Default SSL and vhost config directory: /etc/nginx/conf.d/
  3. Default log file directory: /var/log/nginx/
  4. Default document root directory: /usr/share/nginx/html
  5. Default configuration file: /etc/nginx/nginx.conf
  6. Default server access log file: /var/log/nginx/access.log
  7. Default server access log file: /var/log/nginx/error.log

To edit the nginx configuration file, enter:
# vi /etc/nginx/nginx.conf

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    开发者群
    个人资料
    • 访问:3473926次
    • 积分:35519
    • 等级:
    • 排名:第123名
    • 原创:575篇
    • 转载:199篇
    • 译文:0篇
    • 评论:1842条
    文章存档
    最新评论