
奇怪,我已将文件夹用户/组更改为 www-data ( sudo chown -R www-data:www-data /datos/www
),并将权限更改为 755 ( sudo chmod -R 755 /datos/www
),但 Apache 仍然出现 403 Forbidden 问题。尝试在进程列表中找出 apache 用户,结果如下:
bakhtiyor@sony-vaio:/var/www$ ps aux | grep apache2
root 6627 0.1 0.2 158128 9244 ? Ss 23:23 0:00 /usr/sbin/apache2 -k start
www-data 6632 0.0 0.1 158152 5348 ? S 23:23 0:00 /usr/sbin/apache2 -k start
www-data 6633 0.0 0.1 158152 5348 ? S 23:23 0:00 /usr/sbin/apache2 -k start
www-data 6634 0.0 0.1 158152 5348 ? S 23:23 0:00 /usr/sbin/apache2 -k start
www-data 6635 0.0 0.1 158152 5348 ? S 23:23 0:00 /usr/sbin/apache2 -k start
www-data 6636 0.0 0.1 158152 5348 ? S 23:23 0:00 /usr/sbin/apache2 -k start
1000 6681 0.0 0.0 13468 896 pts/0 S+ 23:23 0:00 grep --color=auto apache2
我的虚拟主机的 Apache 配置文件在这里:
<VirtualHost indextj:80>
ServerAdmin webmaster@indextj
DocumentRoot /datos/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /datos/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
...
...
</VirtualHost>
这是否与 apache 在 root 下运行的第一个进程有关?尽管我不知道为什么 apache 在 root 用户下运行。
需要一些关于解决这个奇怪问题的想法。
谢谢
答案1
这次会议上有些奇怪。不太明白……
<VirtualHost indextj:80>
ServerAdmin webmaster@indextj
DocumentRoot /datos/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /datos/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
...
...
</VirtualHost>
但乍一看我可以告诉你改变AllowOverride
。All
例如,这是我的 wiki 的配置。
<Directory /var/lib/mediawiki/>
Options +FollowSymLinks
AllowOverride All
order allow,deny
allow from all
</Directory>
答案2
尝试在里面添加“允许所有”