标签:
1.增加一个网卡地址(原来是192.168.11.98)
ifconfig eth0:0 192.168.11.99
2.建立站点目录
mkdir /usr/local/nginx/website1
3.建立存放日志的目录
mkdir /var/log/nginx/website1
4.建立测试页
echo "This is website1" > /usr/local/nginx/website1/index.html
5.修改nginx.conf配置文件,添加一个server节点
server{ listen 192.168.11.99:80; server_name localhost; #charset koi8-r; access_log /var/log/nginx/website1/access.log; error_log /var/log/nginx/website1/error.log; location / { root /usr/local/nginx/website1; index index.html index.htm; } #error_page 404 /404.html; #redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html{ root html; } }
6.停止nginx服务
service nginx stop
7.开启nginx服务
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
标签:
原文地址:http://www.cnblogs.com/runnyu/p/4695295.html