您的位置:首页 > 运维架构 > Nginx

RHEL / Centos 6: Install Nginx Using Yum Command

2013-12-05 09:59 435 查看
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

Default configuration directory: /etc/nginx/
Default SSL and vhost config directory: /etc/nginx/conf.d/
Default log file directory: /var/log/nginx/
Default document root directory: /usr/share/nginx/html
Default configuration file: /etc/nginx/nginx.conf
Default server access log file: /var/log/nginx/access.log
Default server access log file: /var/log/nginx/error.log
To edit the nginx configuration file, enter:
# vi /etc/nginx/nginx.conf
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: