你好,我的服务器运行成功,但我卸载了它,然后再次在 YAST(Opensuse)中将其安装为 apache 2
它的输出现在是:
禁止访问!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Fri Aug 5 21:19:30 2011
Apache/2.2.10 (Linux/SUSE)
我更改了 /etc/apache2 中的 default-server.conf,但没有成功,这就是我卸载并再次安装的原因
我将 override None 更改为 override All 并且由于它没有成功,我决定通过卸载和安装来删除更改
我该怎么办?我试过 chmod 777 /srv/www/htdocs/myfile
设置权限
通过输出告诉我:Itworks!
那么问题是什么?
linux-llby:~ # cd /srv/www/htdocs/didebansnort/
linux-llby:/srv/www/htdocs/didebansnort # ls -lha
total 64K
drwxr-xr-x 10 root root 4.0K Aug 6 19:22 .
drwxrwxrwx 8 root root 4.0K Aug 6 19:21 ..
drwxr-xr-x 2 root root 4.0K Aug 6 19:22 SQL
-rwxr--r-- 1 root root 15K Aug 6 19:22 adminuser.php
drwxr-xr-x 9 root root 4.0K Aug 6 19:22 classes
drwxr-xr-x 3 root root 4.0K Aug 6 19:22 config
drwxr-xr-x 3 root root 4.0K Aug 6 19:21 core
drwxr-xr-x 3 root root 4.0K Aug 6 19:22 docs
drwxr-xr-x 3 root root 4.0K Aug 6 19:21 images
-rwxr--r-- 1 root root 3.1K Aug 6 19:21 index.php
-rwxr--r-- 1 root root 2.0K Aug 6 19:22 login.php
drwxr-xr-x 10 root root 4.0K Aug 6 19:22 src
drwxr-xr-x 9 root root 4.0K Aug 6 19:22 theme
httpd.conf的内容:
Include /etc/apache2/ssl-global.conf
# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>
# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
# List of resources to look for when the client requests a directory
DirectoryIndex index.html index.html.var index.php
我更改了 DirectoryIndex 并插入了 index.php
答案1
答案2
错误消息提到了一个名为 的文件/srv/www/htdocs/index.html
。它在那儿吗?可读吗?如果没有,那么这就是您收到上述错误的原因。
编辑:
并且每个(子)文件夹至少需要一个 index.html。
答案3
伙计们,我在 Windows 下遇到了同样的问题,我通过更改以下行解决了该问题:
Deny from all
到:
Allow from all
并且运行正常。但是我不确定这是否会带来一些安全问题?