Ubuntu14.04配置文件Apache2.conf


  關於ubuntu配置文件,嚴格地說Ubuntu的Apache的配置文件是 /etc/apache2/apache2.conf,Apache在啟動時會自動讀取這個文件的配置信息。而其他的一些配置文件,如 httpd.conf等,則是通過Include指令包含進來。在apache2.conf中可以找到這些Include行: 

# Include module configuration: 
Include /etc/apache2/mods-enabled/*.load 
Include /etc/apache2/mods-enabled/*.conf 

# Include all the user configurations: 
Include /etc/apache2/httpd.conf 

# Include ports listing 
Include /etc/apache2/ports.conf 
…… 

# Include generic snippets of statements 
Include /etc/apache2/conf.d/ 

# Include the virtual host configurations: 
Include /etc/apache2/sites-enabled/ 

  結合注釋,可以很清楚地看出每個配置文件的大體作用。當然,你完全可以把所有的設置放在apache2.conf或者httpd.conf或者任何一個配置文件中。Apache2的這種划分只是一種比較好的習慣。 

  安裝完Apache后的最重要的一件事就是要知道Web文檔根目錄在什么地方,對於Ubuntu而言,默認的是/var/www。怎么知道 的呢?apache2.conf里並沒有DocumentRoot項,httpd.conf又是空的,因此肯定在其他的文件中。經過搜索,發現在 /etc /apache2/sites-enabled/000-default中,里面有這樣的內容: 

NameVirtualHost * 
<VirtualHost *> 
ServerAdmin webmaster @localhost 

DocumentRoot /var/www/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM