Setup .htpasswd

Agar website anda tidak dapat diakses oleh public anda bisa menggunakan .htpasswd, sehingga setiap ada yang ingin mengakses web anda, user harus login terlebih dahulu.

1. Setup file .htaccess
Buat file atau tambahkan baris berikut di .htaccess

AuthName "Password Protect Directory"

AuthType Basic
AuthUserFile /var/www/html/.htpasswd
<Limit GET POST PUT>
Require valid-user
</Limit>


2. Setup .htpasswd
Ketikkan perintah berikut di console:
# htpasswd -c /var/www/html/.htpasswd nama_username

Masukkan password untuk nama-username

3. Testing
Buka browser kemudian akses website nya, kalau berhasil maka akan muncul jendela login.
Share on Google Plus

About Admin

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.

0 comments: