1. 程式人生 > >雞蛋學運維-6:nginx服務安裝配置

雞蛋學運維-6:nginx服務安裝配置

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服務安裝配置