Membatasi akses dengan .htaccess

tux

Tahap-tahap membuat htaccess
———————————–
#vim /var/www/cgi-bin/.htaccess

Masukin konfigurasi berikut ini.

AuthUserFile /var/www/cgi-bin/.htpasswd
AuthGroupFile /dev/null
AuthName “admuser Admin”
AuthType Basic

<limit GET POST>
require valid-user
</limit>

Selanjutnya
#htpasswd -c /var/www/cgi-bin/.htpasswd admin
masukan passwd untuk admin.

Lalu ubah hak akses
#chmod 644 /var/www/cgi-bin/.htaccess

Lakukan perubahan di httpd.conf lalu ubah option AllowOveride menjadi AllowOveride All

Selanjutnya lakukan restart

#service httpd restart

akses ke http://%5Bip server]/ cgi-bin/

Seharusnya akan muncul username dan password.

Semoga berhasil

adi maulana

One response to “Membatasi akses dengan .htaccess

  1. cool guys, but i’m not try it yet.
    but, however thanx. Kept Linux Spirit!!!

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