1. 程式人生 > >Linux-LNMP-Nginx的配置

Linux-LNMP-Nginx的配置

Linux-LNMP-Nginx

Nginx默認虛擬主機配置

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



Linux-LNMP-Nginx的配置