How to Allow IP Addresses with a .htaccess File

Contoh script dibawah untuk membolehkan akses ke sebuah website dengan IP tertentu.

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

 <Directory /var/www/tkj>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
 </Directory>

#service apache2 restart
#nano /var/www/tkj/.htaccess

 order deny,allow
 deny from all

 allow from 1.2.3.1

 allow from 1.2.3.2

Untuk mulai apache versi 2.4 menjadi seperti berikut

 Require ip 1.2.3.1

 Require ip 1.2.3.2

Selengkapnya bisa ke
http://httpd.apache.org/docs/2.4/howto/access.html

Komentar

Postingan populer dari blog ini

Cara memahami dan menghafal model OSI dengan analogi

Pembahasan IT Network Systems Administration Module A DNS (Forward Zone, Reverse Zone, CNAME, MX, Split View)

Table of Contents