首页 > 其他 > 详细

lnmp手动新建虚拟机

时间:2017-06-20 23:15:33      阅读:298      评论:0      收藏:0      [点我收藏+]

1.在home/wwwroot/zhongjie   新建zhongjie文件夹

2.在usr/local/nginx/conf/vhost/zhongjie.conf    新建配置文件zhongjie.conf配置文件

代码如下

server
    {
        listen 99;  #1.访问端口
        #listen [::]:80;
        server_name _;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/zhongjie;  # 2.指向目录

        include other.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/zhongjie.log;  #3.生成日志文件
    }

 

(此代码参考lnmp默认的nginx.conf)

 

然后重启服务器

nginx -s reload  :修改配置后重新加载生效

lnmp手动新建虚拟机

原文:http://www.cnblogs.com/wesky/p/7056752.html

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