标签:www ber invalid sse 题解 创建 站点 ati water
PS:Nginx里的配置文件都是以分号;结尾的。一、编辑nginx主配置文件
进入nginx主配置文件目录下:cd /application/nginx/conf
过滤掉以#开头和空行:egrep -vn "#|^$" nginx.conf >a.log
将源文件备份:mv nginx.conf nginx.conf.ori
修改过滤出来的文件:mv a.log nginx.conf
编辑文件:vim nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name www.ldwt.org;
root html/www;
index index.html index.htm;
}
server {
listen 80;
server_name bbs.ldwt.org;
root html/bbs;
index index.html index.htm;
}
server {
listen 80;
server_name blog.ldwt.org;
root html/blog;
index index.html index.htm;
}
}
修改完成后检查语法:../sbin/nginx -t
如果nginx已启动就重启:../sbin/nginx -s reload
如果nginx未启动则启动:../sbin/nginx start
二、创建站点目录:mkdir ../html/{www,bbs,blog}
for n in www bbs blog;do echo "$n.ldwt.com" >../html/$n/index.html;done
for n in www bbs blog;do cat ../html/$n/index.html;done
三、配置客户端hosts文件
———————————————————————————————————
——————————————问题解决:————————————————
重启或启动nginx时报错:
[root@localhost html]# ../sbin/nginx -s reload
nginx: [error] invalid PID number "" in "/application/nginx1.6.2/logs/nginx.pid"
解决:/application/nginx/sbin/nginx -c /application/nginx/conf/nginx.conf
cd ../logs
ll
标签:www ber invalid sse 题解 创建 站点 ati water
原文地址:http://blog.51cto.com/13233089/2130715