Ubuntu下apache2的錯誤

yeahokay發表於2007-10-17

1、系統的提示是
Forbidden

You don't have permission to access / on this server.
Apache/2.2.3 (Ubuntu) PHP/5.2.1 Server at localhost Port 80

解決方法:

chmod -R 777 /var/www/(此為apache2的預設DocumentRoot,如沒改變,就是這樣輸入即可,但可惜在Ubuntu下,你每新增一個檔案,都要chmod一下,十分不方便)

我的做法就是:在***/home/下新建一目錄www,然後sudo gedit /etc/apache2/sites-available/default 把DocumentRoot改為**/home/www/,再sudo apache2 -k restart即可。

2、在啟動apache2時候,提示 httpd: apr_sockaddr_info_get() failed for linux
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(9Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs


解決方法:

sudo gedit /etc/apache2/httpd.conf ,加入ServerName *****即可。

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/786540/viewspace-977131/,如需轉載,請註明出處,否則將追究法律責任。

相關文章