2017-02-19 71 views
0

我Apache2的站點配置,因爲我能看到我的index.html裏面寫的內容:爲什麼目錄沒有被添加到apache2 web服務器中?

enter image description here

現在我想補充的目錄結構,這樣的conf文件裏面我所做的更改如下:

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    ServerName share.com 
    ServerAlias www.crap.com 
    DocumentRoot /var/www/crap.com/public_html 
    Alias /vagrant /home/vagrant/services 
    <Directory "/home/vagrant/services"> 
      Options None 
      AllowOverride All 
      Order allow,deny 
      Allow from all 
    </Directory> 
    ErrorLog ${APACHE_LOG_DIR}/error.log 
    CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost> 
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet 

但在網絡服務器上我看不到任何目錄結構出現。 因此,請提出爲什麼我無法在頁面上添加目錄結構以及如何解決? 當我嘗試訪問192.168.10.10/vagrant我得到如下窗口:

enter image description here

下面是ls -l命令的結果: enter image description here

+0

當你訪問http://192.168.10.10/vagrant時,你可以分享截圖嗎? –

+0

將這個'Options None'替換爲'Options Indexes FollowSymLinks',然後檢查。 –

+0

@SahilGulati我已經替換了選項,正如你所告訴的那樣,並添加了屏幕截圖 – Learner

回答

1

使用Apache的這種配置。希望它能正常工作。

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    ServerName share.com 
    ServerAlias www.crap.com 
    DocumentRoot /var/www/crap.com/public_html 
    Alias /vagrant /home/vagrant/services 
    <Directory "/home/vagrant/services"> 
      Require all granted 
      Options Indexes FollowSymLinks 
      AllowOverride All 
      Order allow,deny 
      Allow from all 
    </Directory> 
</VirtualHost> 
+0

我的確如所告知的,但問題仍然沒有解決。顯示與禁止相同的消息。 – Learner

+0

@學習者請檢查該路徑是否存在?做一件事改變你的路徑/家 –

+0

是改變/家工作..但我怎樣才能獲得流浪子內的子目錄現在。它不顯示流浪者目錄內的任何內容。 – Learner

相關問題