26 April 2018

steps

  1. add nginx repo

    1. create /etc/yum.repos.d/nginx.repo

       # method 1
       $ nano /etc/yum.repos.d/nginx.repo
      
       [nginx]
       name=nginx repo
       baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
       gpgcheck=0
       enabled=1
      
       # method 2
       echo -e "[nginx]\nname=nginx repo\nbaseurl=http://nginx.org/packages/centos/\$releasever/\$basearch\nenabled=1\ngpgcheck=0" > /etc/yum.repos.d/nginx.repo
      
    2. install after nginx repo setup

       $ yum install nginx
      
  2. config

    1. auto start and shutdow

       $ chkconfig nginx on
      
    2. config file

       # reverse proxy
       $ nano /etc/nginx/nginx.conf
      
    3. start

       $ /etc/init.d/nginx start
       ...
       $ ifconfig eth0 | grep inet | awk '{ print $2 }'
      

reference

  1. https://github.com/rharmonson/richtech/wiki/Installing-Nginx-on-CentOS-6.5-Minimal-x86_64

  2. http://wiki.nginx.org/Install#Official_Red_Hat.2FCentOS_packages



blog comments powered by Disqus