- 首先移除很坑的防跨目錄功能
LNMP 1.4上如果不想用防跨目錄還需要將/usr/local/nginx/conf/fastcgi.conf
里面的
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
刪除
LNMP 1.4上也可以直接使用lnmp1.4/tools/
目錄下的./remove_open_basedir_restriction.sh
進(jìn)行移除。
LNMP1.4自帶的這個(gè)工具會(huì)刪除網(wǎng)站目錄的
.user.ini
和nginx的fastcgi.conf里面的fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
重啟nginx。
編輯站點(diǎn)的nginx配置文件 將
xxxxx.cn
換成你的域名
vim /usr/local/nginx/conf/vhost/xxxxx.cn.conf
將下面的配置文件貼進(jìn)去
server
{
listen 80;
#listen [::]:80;
# server_name 換成你的域名
server_name xxxxx.cn ;
index index.html index.htm index.php default.html default.htm default.php;
# xxxxx.cn 換成你的域名
root /home/wwwroot/xxxxx.cn/public;
# laravel 文檔給的nginx配置
location / {
try_files $uri $uri/ /index.php?$query_string;
}
include fastcgi.conf;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/info.log;
}
- 重啟nginx
/etc/init.d/nginx restart
- 完成
image.png