(Impelementasi pada Debian 7.8 dan Apache versi 2)

# apt-get install apache2 apache2-utils
# sudo htpasswd -c /etc/apache2/.htpasswd user01
# sudo htpasswd /etc/apache2/.htpasswd user02

# cat /etc/apache2/.htpasswd
———————————————-
user01:$apr1$lzxsIfXG$tmCvCfb49vpPFwKGVsuYz.
user02:$apr1$p1E9MeAf$kiAhneUwr.MhAE2kKGYHK.
———————————————-
# sudo nano /etc/apache2/sites-available/training
———————————————-
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName training.indonesiahebat.net
DocumentRoot /var/www/training
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory “/var/www/training”>
        AuthType Basic
        AuthName “Restricted Content”
        AuthUserFile /etc/apache2/.htpasswd
        Require valid-user
        AllowOverride All
    </Directory>
</VirtualHost>

———————————————-

uji coba akses website training.indonesiahebat.net,
maka akan meminta autentifikasi untuk login…..

 

sumber : https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-14-04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s