2016-01-13 15 views
0

我有一個內部網站,我打電話給eaglets。我用它來主持一堆的JavaScript計算器等。我想使用laravel應用程序,並且地址看起來像http://eaglets/playground此apache2.4和laravel安裝程序的適當虛擬主機是什麼?

我在我的var/www/html目錄中有操場文件夾,這是我的默認文檔根目錄。

如果我在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" 

回答

0

我有同樣的用例和這裏的配置(名稱&路徑改爲你的):

<VirtualHost *:80> 
    ServerName eaglets 
    Alias /playground /var/www/html/playground/public 

    <Directory /var/www/html/playground/public> 
     Options FollowSymLinks 
     AllowOverride All 
    </Directory> 
</VirtualHost>