linux系統中apache啟動時的設定檔路徑

來源:互聯網
上載者:User

問題:安裝了apache後,修改/user/local/apache2/conf/httpd.conf檔案中的documentroot參數,但訪問的仍然是/var/www/html中的內容,即便是刪除了該設定檔,apache也能正常啟動。

 

所以問題的原因是apache的預設配置路徑不是ser/local/apache2/conf/httpd.conf,而是/etc/httpd/conf/httpd.conf。

 

----補充說明-----------------------

 

在修改/etc/httpd/conf/httpd.conf中的DocumentRoot後,如果重啟apache出下如下錯誤:

DocumentRoot must be a directory

 

這是因為是使用了SELinux,有兩種方法解決:

 

方法一:禁止使用SELinux,運行:
system-config-securitylevel (或 redhat-config-securitylevel)

來禁止對http的SELinux設定。

 

方法二:或給新路徑設定SELinux許可權:
chcon -R -h -t httpd_sys_content_t /wwwroot

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.