码迷,mamicode.com
首页 > 其他好文 > 详细

鸡蛋学运维-6:nginx服务安装配置

时间:2017-10-13 14:59:05      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:nginx

nginx安装配置

1.安装-(web-lnmp-172.16.1.4)

2.

3.

4.

/application/nginx/sbin/nginx -t

/application/nginx/sbin/nginx -V

/application/nginx/sbin/nginx -s reload

vim /application/nginx/sbin/nginx/conf/nginx.conf


worker_processes  1;

events {

    worker_connections  1024;

}

http {

    include       mime.types;

    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    #nginx vhosts config

include extra/www.conf;

include extra/bbs.conf;

include extra/blog.conf;

include extra/status.conf;

}




cat >/application/nginx/conf/extra/www.conf<<EOF

server {

        listen       80;

        server_name  www.etiantian.org;

        location / {

            root   html/www;

            index  index.html index.htm;

                   }

                    

}

EOF

cat >/application/nginx/conf/extra/bbs.conf<<EOF

 server {

        listen       80;

        server_name  bbs.etiantian.org;

        location / {

            root   html/bbs;

            index  index.html index.htm;

                   }

        }

EOF


cat >/application/nginx/conf/extra/blog.conf<<EOF


server {

        listen       80;

        server_name  blog.etiantian.org;

        location / {

            root   html/blog;

            index  index.html index.htm;

                   }

        }

EOF


cat >/application/nginx/conf/extra/status.conf<<EOF

##STATUS

server {

        listen       80;

        server_name  status.etiantian.org;

        location / {

            stub_status on;

            access_log off;

                   }

       }

EOF


本文出自 “有压力的鸡蛋” 博客,请务必保留此出处http://78124107.blog.51cto.com/5557978/1972010

鸡蛋学运维-6:nginx服务安装配置

标签:nginx

原文地址:http://78124107.blog.51cto.com/5557978/1972010

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!