2016-05-15 52 views
1

當我這樣做:如果沒有啓用網站,應該顯示apache默認頁面嗎?

sudo a2dissite 

我得到

Your choices are: 

意味着所有的網站都被禁止。

當我把我的IP本地網絡地址放在瀏覽器中時,我得到了默認的Apache頁面。

http://192.168.1.101/ (putting this in the browser address bar gets me the default apache page) 

sudo service apache2 stop 

停止Apache給了我 '該網站無法到達',那麼Apache是​​服務於默認頁。

那麼,當沒有網站啓用時,是否顯示apache默認頁面?

後續工作:我將如何製作一個不同的目錄默認?我有一個test.conf設立

<VirtualHost 127.0.0.2:80> 

    ServerAdmin [email protected] 
    DocumentRoot /home/myusername/websites/wp-test-site/site 

    ErrorLog ${APACHE_LOG_DIR}/error.log 
    CustomLog ${APACHE_LOG_DIR}/access.log combined 

</VirtualHost> 

我認爲這使這將使默認的站點文件夾中的/ home /名爲myUsername /網站/ WP-測試網站/網站,但事實並非如此。

是的我重新啓動與sudo。

回答

0

將.htaccess文件添加到文檔根目錄。 更改缺省的文件中顯示如下

DirectoryIndex index.php default.html 

現在把一些在index.php的文檔根目錄。 接下來,您可以從索引文件指向指向用戶的位置。

相關問題