我设置了一个 Apache 服务器,这是我的“sites-availiable”中的配置文件:
<VirtualHost *:80>
ServerName myhostname.com
ServerAdmin webmaster@localhost
DocumentRoot /home/cock/phpmyadmin/
ErrorLog /var/log/apache2/phpmyadmin-error.log
LogLevel warn
CustomLog /var/log/apache2/phpmyadmin-access.log combined
<Directory /home/cock/phpmyadmin>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
# add here your IP addresses
allow from all
</Directory>
</VirtualHost>
` 我将该目录模式更改为 777,但仍然无法访问主页。
答案1
Apache 现在需要Require all granted
,<Directory>
因此像这样编辑:
....
<Directory /home/cock/phpmyadmin>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
# add here your IP addresses
allow from all
Require all granted
</Directory>
...
然后重新加载配置 apache
sudo service apache2 reload