htaccess dan htpasswd untuk otentikasi web

htaccess dan htpasswd untuk otentikasi web (debian squeeze)

# cd /var/www/saya/
# vi .htaccess

AuthType Basic
AuthUserFile /var/www/private.yourdomain.com/htdocs/.htpasswd
AuthName private
require valid-user
satisfy any

# chown -R www-data:www-data /var/www/saya/
# chown www-data:www-data /var/www/saya/.htaccess
# chmod 644 /var/www/saya/.htaccess
# htpasswd -c .htpasswd saya
password:
# cat /var/www/saya/.htaccess

# nano /etc/apache2/sites-available/default

deny from all
Options ExecCGI
AllowOverride AuthConfig
Order deny,allow
satisfy any

# /etc/init.d/apache2 restart

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s