2014年5月8日 星期四

httpd.conf htpasswd 設定

在RedHat/CentOS

1. 透過.htaccess



2. 透過 httpd.conf
vi /etc/httpd/conf/httpd.conf

 # 測試使用的
 <VirtualHost *:80>
     ServerName demo.xxx.com
     ServerAdmin mis@xxx.com
     DocumentRoot /home/yyy/demo
     ErrorLog  logs/demo.error_log
     CustomLog logs/demo.access_log common
     <Directory "/home/yyy/demo">
       Options Indexes FollowSymLinks
       AllowOverride None
       Order allow,deny
       Allow from all

       AuthUserFile /home/yyy/.htpasswd
       AuthName "Password please"
       AuthType Basic
       Require valid-user
     </Directory>
 </VirtualHost>


沒有留言:

張貼留言