您无权访问/在此服务器上 [英] You don't have permission to access / on this server

查看:273
本文介绍了您无权访问/在此服务器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 CentOS 6.1 服务器,我在上面安装了 apache 2.2.15.现在,当我尝试从 IE (http:///(=centos ip)) 的另一台电脑(Windows 7)访问它时,我收到您无权访问/对此服务器."错误.我什至在var/www/html"上创建了内容为"的 phpinfo.php 文件,当我尝试在 IE 中使用http://*/phpinfo.php"访问它时,我没有发现错误.我该怎么办?我的 httpd.conf 目录是这样的:

I have CentOS 6.1 server and I installed apache 2.2.15 on it. Now When I try to access it from another pc (windows 7) from IE (http:/// (=centos ip)) I get the "You don't have permission to access / on this server." error. I even created phpinfo.php file with content of "" on "var/www/html" and when I try to access it by using "http://*/phpinfo.php" in IE, I get not found error. What should I do? my httpd.conf for directiry is like this:

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

推荐答案

编辑 httpd.conf 文件,该文件位于 /etc/httpd/conf/httpd.conf.添加以下代码.

Edit httpd.conf file, which is in /etc/httpd/conf/httpd.conf. Add the below code.

<Directory "/">
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Allow from all
</Directory>

<Directory "/home/">
 #Options FollowSymLinks
 Options Indexes FollowSymLinks Includes ExecCGI
 AllowOverride None
 Allow from all
</Directory>

行号之后.555(就我而言).检查文件权限并重新启动服务器.

After the line no. 555 (in my case) . Check for the file permissions and restart the server.

service httpd restart   

现在,它会起作用.您仍然面临同样的问题,禁用 /etc/selinux/config 中的 seLinux 更改 SELINUX=disabled 并如上所述重新启动服务器并尝试一下.

Now, it will work . Still you are facing the same problem, disable the seLinux in /etc/selinux/config change SELINUX=disabled and restart the server as mentioned above and try it.

希望能帮到你

这篇关于您无权访问/在此服务器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆