DocumentRoot does not exist

在配置apache的虚拟主机的时候,设置如下:

<VirtualHost *:8080>

    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/share
    ServerName tt.dd.com
    ErrorLog /www/logs/dummy-host.example.com-error_log
    CustomLog /www/logs/dummy-host.example.com-access_log common
   php_value error_reporting     7

  RewriteEngine On

RewriteRule ^(/themes/.*)$    $1             [L,QSA]
RewriteRule ^(.*\.)(php|xml|txt|jpg|gif|png|swf|css|js|html|htm)$       $1$2    [L,QSA]
RewriteRule ^/p/(\d+)/(\d+)$  /album/image-id-$1-size-$2

RewriteRule ^/(\w+)$                /$1/     [R=301,L,QSA]
RewriteRule ^/(\w+/\d+/\w+)$        /$1/     [R=301,L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$                      /index.php?_RW_=$1          [L,QSA]

</VirtualHost>
apache重启的时候,报文件目录没找到

[root@bogon www]# service httpd start
正在启动 httpd:Warning: DocumentRoot [/www/share] does not exist
httpd: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
                                                           [失败]
[root@bogon www]# ^C

可是明明/www/share的文件夹已经存在,权限也设置好了。找了很久的原因,原来是seLinux的错误。关于seLinux的资料,网上很多,就不细讲。解决方案是:

/usr/bin/setenforce 是用来修改SELinux的实时运行模式的
 临时打开:
setenforce 1          ----设置SELinux 成为enforcing模式
 临时关闭:
setenforce 0          ----设置SELinux 成为permissive模式
 如果要彻底禁用SELinux 需要在/etc/sysconfig/selinux中设置参数selinux=0 ,或者在/etc/grub.conf中添加这个参数
 /usr/bin/setstatus -v
就是关闭selinux就可以了。解决方案,是网上找的。不过,我找了很久才找到。特此整理

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值