2012年9月13日 星期四

htaccess don't work no apache2, CustomLog don't dork



今天寫網頁時,發生了兩個問題:
1. .htaccess 沒有正常工作
2. 自訂 CustomLog ,不會正常輸出 log 內容 ( 有產生 log 檔案,但檔案內容一直都是空的 )


第一個問題,原因是:Using apache2 on a Ubuntu, the .htaccess does not work !
reference : https://www.dokuwiki.org/security

解決方法如下:

In the /etc/apache2/sites-available you need to modify the file default (or the file default-ssl if you use https rather than http)

Default for AllowOverride in the <Directory /var/www/> is none, should be all


第二個問題的解決方法:
別在 apache.conf 寫 CustomLog 腳本,要寫在這個檔案
 /etc/apache2/sites-available/default 才會動

沒有留言:

張貼留言