Software And Internet Blog





May 1, 2008

Proteksi Direktori Web Menggunakan .htaccess Pada Linux

Filed under: System Security

ika anda mempunyai direktori web yang tidak ingin diakses oleh orang lain, maka cara di bawah ini bisa anda terapkan untuk hal tersebut. Metodanya adalah setiap orang yang akses ke direktori web tersebut akan ditampilkan prompt username dan password untuk otentikasi.

Langkah-langkah:

1) Buat file .htaccess yang ditempatkan/disimpan dalam direktori web yang diproteksi misalnya direktori /home/httpd/htdocs, dengan konfigurasi:

AuthUserFile /home/httpd/htdocs/.htpasswd
AuthGroupFile /dev/null
AuthName “Private Administrative Zone”
AuthType Basic

require valid-user

2) Buat file untuk menyimpan data username dan password dengan nama yang tertera pada AuthUserFile, menggunakan perintah:

~# htpasswd -c /home/httpd/htdocs/.htpasswd sibolang
New password:

Re-type new password:

Adding password for user sibolang
~#

.htpasswd adalah file untuk menyimpan username dan passoword (tidak harus dengan nama .htpasswd), username-nya adalah sibolang dan password-nya yang anda isikan. Untuk menambah user lainnya gunakan perintah htpasswd tanpa -c

3) Untuk menghapus user, buka file .htpasswd tersebut dan hapuslah user yang anda inginkan.

4) Jangan lupa untuk mengubah konfigurasi httpd.conf Apache pada home direktori yang diproteksi tersebut, yaitu pada perintah AllowOverride None ke AllowOverride All


< -directory “/home/httpd/htdocs”>
Options None
AllowOverride None
Order allow,deny
Allow from all
< -/directory>

Menjadi:


< -directory “/home/httpd/htdocs”>
Options None
AllowOverride All
Order allow,deny
Allow from all
< -/directory>

Comments »

The URI to TrackBack this entry is: http://blackraptor.blogsome.com/2008/05/01/proteksi-direktori-web-menggunakan-htaccess-pada-linux/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.








Get free blog up and running in minutes with Blogsome
Theme designed by B A Khan