鸡蛋学运维-6:nginx服务安装配置
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了鸡蛋学运维-6: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服务安装配置的主要内容,如果未能解决你的问题,请参考以下文章