Nginx源码包安装的配置文件/usr/local/nginx/conf/nginx.conf
注释掉server{},增加http{include vhost/*.conf;}
mkdir /usr/local/nginx/conf/vhost
vim /usr/local/nginx/conf/vhost/apeng.com.conf
server { listen 80 default_server; server_name apeng.com; index index.html index.htm index.php; root /data/wwwroot/default; }
mkdir -p /data/wwwroot/default
vim /data/wwwroot/default/index.html
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx -s reload
curl localhost
原文地址:http://blog.51cto.com/13480443/2074045