lnmp手动新建虚拟机

2023-05-26,,

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

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

代码如下

server
{
listen ; #.访问端口
#listen [::]:;
server_name _;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/zhongjie; # .指向目录 include other.conf;
#error_page /.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; #.生成日志文件
}

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

然后重启服务器

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

lnmp手动新建虚拟机的相关教程结束。

《lnmp手动新建虚拟机.doc》

下载本文的Word格式文档,以方便收藏与打印。