我的虚拟主机上的Apache 500内部服务器错误

Mwi*_*Tim 5 apache ubuntu lamp virtualhost vhosts

我的网络应用程序项目位于/ media/disk1/Projects中的文件夹中.我想使用Apache虚拟主机来为它们提供服务http://lab/.

这就是我设置虚拟主机的方式:

1.将/ etc/apache2/sites-available/default复制到/ etc/apache2/sites-available/lab

2.编辑/ etc/apache2/sites-available/lab到以下内容:

<VirtualHost *:80>
ServerAdmin tim@localhost
ServerName lab

DocumentRoot /media/disk1/Projects
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
# <Directory /var/www/>
<Directory /media/disk1/Projects>
    Require all granted
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)

3.添加127.0.0.1 lab到我的/ etc/hosts:

127.0.0.1   localhost
127.0.0.1   lab
Run Code Online (Sandbox Code Playgroud)

4. http://lab只能访问500 Internal Server Error

所有子文件夹权限都设置为drwxrwxrwx但我的http://lab/phpmyadmin工作.

帮我解决 谢谢.

Mwi*_*Tim 27

通过查看此论坛解决了错误; http://boinc.berkeley.edu/dev/forum_thread.php?id=8603 在我的/var/log/apache2/error.log上,最后一个错误是:

[Wed Oct 09 09:10:04 2013] [crit] [client 127.0.0.1] configuration error:  couldn't perform authentication. AuthType not set!: /
Run Code Online (Sandbox Code Playgroud)

所以我跟着别人的解决方案并评论了这条线

# Require all granted
Run Code Online (Sandbox Code Playgroud)

就在我的/ etc/apache2/sites-available/lab和TADA上!我能够在浏览器中列出我的Projects目录.

  • 评论该行使我的错误转换为403禁止,所以显然它并不总是多余的. (2认同)