RHEL / Centos 6: Install Nginx Using Yum Command

2088 단어 nginxredhatforRHEL
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

    좋은 웹페이지 즐겨찾기