【发布时间】:2016-04-17 19:56:21
【问题描述】:
我有一个内部网站,我称之为eaglets。我用它来托管一堆 javascript 计算器等。我想使用一个 laravel 应用程序,并且地址看起来像 http://eaglets/playground。
我的 var/www/html 目录中有 Playground 文件夹,这是我的默认文档根目录。
如果我在我的var/www/html/playground/ 文件夹中放置一个虚拟的index.html 并转到http://eaglets/playground,它会正常运行。这让我相信我的虚拟主机没有正确指向 var/www/html/playground/public 文件夹。
这是我的虚拟主机文件:
1 <VirtualHost *:80>
2
3 ServerName eaglets/playground
4 ServerAlias eaglets/playground
5 DocumentRoot /var/www/html/playground/public
6 <Directory /var/www/html/playground/public>
7 Options -Indexes +FollowSymLinks +MultiViews
8 AllowOverride All
9 Require all granted
10 </Directory>
11
12 ErrorLog ${APACHE_LOG_DIR}/playground-error.log
13 CustomLog ${APACHE_LOG_DIR}/playground-access.log combined
14
15 </VirtualHost>
有什么想法吗?
如果我执行 apachectl -S 我会得到:
VirtualHost configuration:
*:80 is a NameVirtualHost
default server eaglets (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost eaglets (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost eaglets/playground (/etc/apache2/sites-enabled/playground.conf:1)
alias eaglets/playground
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
【问题讨论】: