我有我的Web应用程序项目位于/ media / disk1 / Projects文件夹中。 我想在http://lab/
使用Apache虚拟主机来为他们提供服务。
这是我如何设置我的虚拟主机:
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>
3.将127.0.0.1 lab
添加到我的/ etc / hosts中:
127.0.0.1 localhost 127.0.0.1 lab
4.仅访问http://lab
获取500 Internal Server Error
所有子文件夹权限设置为drwxrwxrwx但是我的http://lab/phpmyadmin
工作。
帮我解决。 谢谢。
错误通过检查此论坛解决; 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!: /
所以我跟着别人的解决方案,并评论线
# Require all granted
就在我的/ etc / apache2 / sites-available / lab和TADA上。 我能够在我的浏览器中列出我的Projects目录。