首页 > 其他 > 详细

lnmp 虚拟主机的配置

时间:2015-11-26 15:28:32      阅读:379      评论:0      收藏:0      [点我收藏+]

在lnmp环境下创建 demo.zhengyang.com。

  1. 在etc/nginx/ 目录下面创建vhosts文件夹 ,然后在vhosts文件夹里面创demo.zhengyang.com.conf配置文件。

  2. 在配置里面放入以下内容:

        server {
    listen       80;
    server_name demo.zhengyang.com;
    index index.html index.htm index.php;

    root  /usr/share/nginx/html/zhengyang;
 
    location ~ \.php$ {
        root           /usr/share/nginx/html/zhengyang;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html/zhengyang/$fastcgi_script_name;
        include        fastcgi_params;
    }
}

    3.我的localhost在 usr/share/nginx/html下,在html目录下面创建zhengyang  这个文件夹  在文件夹里面创建一个1.php文件

    4.在etc/hosts文件下面添加如图所示

    技术分享

lnmp 虚拟主机的配置

原文:http://zhengyang.blog.51cto.com/7792351/1717062

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!