linux复盘:构架搭建lnmp(配置)
nginx虚拟主机 vim /usr/local/nginx/conf/nginx.conf 增加include vhost/*.conf; mkdir /usr/local/nginx/conf/vhost vim /usr/local/nginx/conf/vhost/aaa.com.conf #虚拟主机配置文件 server { listen 80 default_server; (有default_serve就是默认虚拟主机) server_name aaa.com; (定义网站名字) index index.html index.htm index.php; root /data/wwwroot/default; (定义配置文件目录,还没创建) } 如果给虚拟主机配置php解析就加入: server { listen 80 default_server; server_name aaa.com; index index.html index.htm index.php; root /data/wwwroot/default; location ~ \.php$ { include fastcgi_params; fastcgi_pass unix:/tmp/php-fcgi.sock; fastcgi_index index.php; fastcgi_param