VPS侦探论坛

 找回密码
 注册
查看: 9141|回复: 9

老大为何修改了apache目录就不行了?

[复制链接]
发表于 2011-4-29 11:26:04 | 显示全部楼层 |阅读模式

lnmp0.7 然后又安装了apache
apache的documentroot 默认是/home/wwwroot
我修改了httpd.conf文件  将documentroot 修改成 /data/web   ,然后把 /home/wwwroot下面的p.php, phpmyadmin, phpinfo.php 都mv 到 /data/web/下面 (/data是我的另外一个扩展分区 ) serverroot没有动。然后重启apache 发现如下错误:
Object not found!The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404192.168.10.67
Fri Apr 29 11:11:41 2011
Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8b PHP/5.2.17
  另外,安装包里的readme文件有提到apache 的状态管理是/root/httpd {.....}可是没有/root/httpd 这个文件 我只能whereis apachectl 然后 重启apache.

[ 本帖最后由 puffbaby 于 2011-4-29 11:27 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-4-29 12:21:14 | 显示全部楼层


nginx.conf 的
root 也修改成 /data/web
还是不行
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-4-29 12:42:46 | 显示全部楼层

Apache状态管理:/etc/init.d/httpd {start|stop|restart|graceful|graceful-stop|configtest|status}
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-4-29 13:49:58 | 显示全部楼层



原帖由 licess 于 2011-4-29 12:42 发表
Apache状态管理:/etc/init.d/httpd {start|stop|restart|graceful|graceful-stop|configtest|status}

那个documentroot 更换怎么解决啊?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-4-29 13:56:03 | 显示全部楼层

回复 4# 的帖子


/home/wwwroot/的设置是在/usr/local/apache/conf/extra/httpd-vhosts.conf  这里的

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2011-4-29 14:00:36 | 显示全部楼层

原帖由 licess 于 2011-4-29 13:56 发表
/home/wwwroot/的设置是在/usr/local/apache/conf/extra/httpd-vhosts.conf  这里的

那nginx.conf 不需要修改的吧?
发表于 2011-4-29 14:09:51 | 显示全部楼层

回复 6# 的帖子


都必须改。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-4-29 14:23:57 | 显示全部楼层

原帖由 licess 于 2011-4-29 14:09 发表
都必须改。
  1. cat /usr/local/apache/conf/httpd.conf | grep DocumentRoot
  2. #DocumentRoot "/home/wwwroot"
  3. DocumentRoot "/home/wwwroot"

  4. cat /usr/local/nginx/conf/nginx.conf | grep root
  5. #root /home/wwwroot ;
  6. root /data/web ;

  7. cat /usr/local/apache/conf/extra/httpd-vhosts.conf | grep DocumentRoot
  8. #DocumentRoot "/home/wwwroot"
  9. DocumentRoot "/data/web"

  10. /root/lnmp restart
  11. 只有PHP-FPM not running
  12. /usr/local/php/sbin/php-fpm没有那个文件或目录
  13. /etc/init.d/httpd stop
  14. /etc/init.d/httpd start
复制代码

结果index.html 和 phpMyAdmin 正常显示了
但是 探针 和phpinfo 报错
探针的报错:
Warning: Unknown: open_basedir restriction in effect. File(/data/web/p.php) is not within the allowed path(s): (/home/wwwroot:/tmp/:/var/tmp/:/proc/) in Unknown on line 0

Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Fatal error: Unknown: Failed opening required '/data/web/p.php' (include_path='.:') in Unknown on line 0

phpinfo的报错:
Warning: Unknown: open_basedir restriction in effect. File(/data/web/phpinfo.php) is not within the allowed path(s): (/home/wwwroot:/tmp/:/var/tmp/:/proc/) in Unknown on line 0

Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Fatal error: Unknown: Failed opening required '/data/web/phpinfo.php' (include_path='.:') in Unknown on line 0
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-4-29 14:31:36 | 显示全部楼层

搞定了  home/wwwroot:/tmp/:/var/tmp/:/proc 添加 路径 /data/web

军哥运维代购:http://shop63846532.taobao.com/

发表于 2011-4-29 15:04:49 | 显示全部楼层

回复 8# 的帖子




升级到lnmpa后要用/root/lnmpa 管理
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-20 10:51 , Processed in 0.028234 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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