Create apache web password with using htpasswd

1)

htpasswd -cm /etc/web_passwd admin
htpasswd -cmb /etc/web_passwd admin password
Create MD5 http password in /etc/web_passwd



2)

vi /etc/httpd/conf/httpd.conf
<Directory "/var/www/html/secret"> Options None AllowOverride None Order allow,deny Allow from all AuthType Basic AuthName "Authentication" AuthUserFile /etc/web_passwd Require valid-user </Directory>


3)

/etc/init.d/httpd restart


PS: Other method is using .htaccess and place to secert folder

vi ./htaccess

AuthType Basic
AuthName "Authentication"
AuthUserFile /etc/web_passwd
Require valid-user

vi /etc/httpd/conf/httpd.conf
<Directory "/var/www/html/secret"> Options None AllowOverride AuthConfig Order allow,deny Allow from all </Directory>




Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.