Labels

Linux (46) network (13) troubleshoot (13) command (10) virtualization (10) ubuntu (9) Windows (8) cisco (7) security (7) router (6) Tools (5) software (5) vmware (5) ospf (3) eigrp (1) zimbra (1)

2010年5月26日

Apache htaccess simple config

AllowOverride AuthConfig - Provide login screen before view the web site
Sample config:
httpd.conf
====================================
    Options FollowSymLinks
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all

AccessFileName .htaccess
====================================

/var/www/html/.htaccess

====================================
AuthName     "htaccess protect"
Authtype     Basic
AuthUserFile /var/www/.htpasswd <---the .htpasswd file will be created later
require      valid-user
(or you can change to specify user "require user     tom")
====================================

Create .htpasswd file:
htpasswd -c /var/www/.htpasswd owner

Add another account:htpasswd /var/www/.htpasswd tom

沒有留言:

張貼留言