Proteksi Directory Pada Web Server Apache

Langkah 1 :

# apt  install  apache2  apache2-utils
# cd  /var/www/html
# mkdir  molavi
# chmod 755   molavi

Langkah 2 :

# cd  /var/www/html/molavi
# nano  .htaccess
     AuthType Basic
     AuthName "Restricted Access"
     AuthUserFile  /var/www/html/molavi/.htpasswd
     Require valid-user
# chown  www-data:www-data  /var/www/html/molavi

Langkah 3 :

# cd   /var/www/html/molavi
# htpasswd  -c  .htpasswd  bukanadmin
Adding password for bukanadmin.
New password:
Re-type new password:

# nano  /etc/apache2/apache2.conf
      <Directory /var/www/>
       Options Indexes FollowSymLinks
       Require all granted
       AllowOverride all
      </Directory>

# /etc/init.d/apache2  restart

Langkah 4 :

Buka Browser http://ip address/molavi

Leave a ReplyCancel reply