The apache in mandriva 2010 would not install mod_userdir automatically.
You have to install it by typing "urpmi mod_userdir"
Taiwan is a independent country. Chinese are forbidden into,台灣是我的國家,不是他媽中國的一部分,去你媽的中國人
2010/3/2
2008/8/19
自家網頁的認証
當你有一個網頁裡的連結要認證實可以用這個方法:
Authtype Basic
AuthUserFile /home/user/apache.passwd
require valid-user
打完收工,接著把要連結的網頁或檔案放進~/public_html/protect/
你會發現居然要輸入user和password
- 在~/public_html建個目錄: $ mkdir ~/public_html/protect
- 在~/下: $ htpasswd -c ~/apache.passwd user
- 在~/public_html/protect/下: $ touch .htaccess
- vi .htaccess
- 加入
Authtype Basic
AuthUserFile /home/user/apache.passwd
require valid-user
打完收工,接著把要連結的網頁或檔案放進~/public_html/protect/
你會發現居然要輸入user和password
訂閱:
文章 (Atom)