Google
 

音樂分享 - 「君がいるから」by 江口一聲

2007年7月27日 星期五

apache2 底下的 public_html 路徑老是對映到 /var/www 的錯誤原因

有同樣問題的朋友,我的情況是,在升級到 Debian GNU/Linux r4.0 後,Apache2 預設不會載入 userdir 的 module ,所以使用者就沒有辨法擁有個人網頁了。

我的情況:
當我執行 http://123.45.67.89/~061/打我啊,笨蛋.htm 時,會在 /var/log/apache2/error.log 裏看到 File does not exist: /var/www/~061 而不是 File does not exist: /home/061/public_html/打我啊,笨蛋.htm 。

要確定載入了哪些 modules ,執行 apache2ctl -M 。

在 Debian GNU/Linux r4.0 底下,要讓 Apache2 載入 userdir modules 的做法是,執行:
# cd /etc/apache2/mods-enabled
# ln -s ../mods-available/userdir.load .
# ln -s ../mods-available/userdir.conf .
# apache2ctl -k restart (重新啟動 apache2)

再執行一次 apache2ctl -M ,看看有沒有 userdir ? 就知道有沒有成功了!!

沒有留言: