VPS侦探论坛

 找回密码
 注册
查看: 4709|回复: 1

求教安全设置、文件上传、用户组

[复制链接]
发表于 2012-2-5 13:23:41 | 显示全部楼层 |阅读模式

我需要将安全模式打开,并且需要支持文件上传应该如何设置?nginx.conf:

user  www www;


上传临时目录:/home/wwwroot/tmp

php.ini

safe_mode = On

safe_mode_gid = On

safe_mode_include_dir =

safe_mode_exec_dir = /usr/bin


网站目录所属:

/home root:root

/home/wwwlogs root:root

/home/wwwroot www:www

/home/www www:www

访问网站时是空白的,php_error.log显示如下:
[05-Feb-2012 05:05:33 UTC] PHP Warning:  Unknown: SAFE MODE Restriction in effect.  The script whose uid/gid is 501/501 is not allowed to access /tmp owned by uid/gid 0/0 in Unknown on line 0
[05-Feb-2012 05:05:33 UTC] PHP Fatal error:  Unknown: Failed to initialize storage module: files (path: ) in Unknown on line 0

--------------------------------------------

如果把nginx.conf改成

user root root;

把/home下所有目录及子目录都改成root:root
这样倒是可以显示网页了,但是不是不安全啊,而且上传文件的时候仍旧失败
php_error.log显示如下:
[05-Feb-2012 05:10:27 UTC] PHP Warning:  Unknown: SAFE MODE Restriction in effect.  The script whose uid/gid is 501/501 is not allowed to access /tmp owned by uid/gid 0/0 in Unknown on line 0
[05-Feb-2012 05:10:27 UTC] PHP Fatal error:  Unknown: Failed to initialize storage module: files (path: ) in Unknown on line 0

=================
请老大指导!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-2-5 18:20:58 | 显示全部楼层


不需要你自己修改配置,你改了才会出问题
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-16 15:34 , Processed in 0.024976 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表