centos上安裝配置nginx

先查看nginx進程:ps -ef | grep nginx

強制停止Nginx:pkill -9 nginx

cd /home/test下安裝nginx


wKioL1SKukKxvJpnAAM585_ZjQM201.jpg

cd /home/test/  接下面...


wKiom1SKuanQKm3XAAGPVvWJXhc822.jpg

ifconfig

eth0 inet addr:192.168.2.10 

 server {

      listen       192.168.2.10:80;

      server_name  localhost;

      access_log  /var/log/nginx/access.log;

      error_log  /var/log/nginx/error.log;

      location / {

          root   html;

          index  index.html index.htm;

      }

  }

server{

      listen       192.168.2.10:80;

      server_name  www.abc.com;

      location / {

          root   html;

          index  index.html index.htm;

      }

  }

  server {

      listen       192.168.2.10:80;

      server_name  tec.abc.com;

      location / {

          root   /usr/local/nginx/tec;

          index  index.html index.htm;

      }

}

注意hosts文件的位置:windows下C:\Windows\System32\drivers\etc\hosts,linux下/etc/hosts

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章