帳號密碼保護
AuthType Basic AuthName "Please Log In" AuthUserFile /some/path/.htpasswd Require valid-user
基本上只要放入以上的設定,連到該目錄時就會要求輸入帳號密碼了!
而 .htpasswd 的產生方式如下
htpasswd -c /some/path/.htpasswd newuser
輸入後會問你密碼,輸入兩次後就會產生 .htpasswd 檔案了
AuthType Basic AuthName "Please Log In" AuthUserFile /some/path/.htpasswd Require valid-user
htpasswd -c /some/path/.htpasswd newuser
Order deny,allow Deny from all Allow from 192.168.1.1
AuthType Basic AuthName "Please Log In" AuthUserFile /some/path/.htpasswd Require valid-user Order deny,allow Deny from all Allow from 192.168.1.1 Satisfy any
AuthType Basic AuthName "Please Log In" AuthUserFile /some/path/.htpasswd Require valid-user Order deny,allow Deny from all Allow from 192.168.1.1 Satisfy all