2008年9月1日 星期一

想架一個網站有設密碼的網站要怎麼架設?

How to setup Apache password login access

先幫bob使用者設個密碼
$ sudo htpasswd -c /etc/apache2/passwd/.htpasswd bob

再去apache裏面設定 多家這幾行就好
$ sudo vim /etc/apache2/sites-available/default

AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/apache2/passwd/.htpasswd
Require user bob


從新啟動Apache
$ sudo /etc/init.d/apache2 restart

沒有留言: