PC-23

"Sebaik-baik manusia adalah mereka yang bermanfaat bagi orang lain"

Breaking

Thursday, March 15, 2018

LAB 8.7 Enable Basic Authentication



Pada kesempatan kali ini saya akan berbagi kepada anda, yaitu konfigurasi Enable Basic Authentication


Berikut Konfigurasinya :

[root@www ~]# vi /etc/httpd/conf.d/auth_basic.conf
----------------------------------------------------------------------------------------
<Directory /var/www/html/auth-basic>
    AuthType Basic
    AuthName "BasicAuthentication"
    AuthUserFile /etc/httpd/conf/.htpasswd
    require valid-user
</Directory>
---------------------------------------------------------------------------------------
[root@www ~]# htpasswd -c /etc/httpd/conf/.htpasswd cent
----------------------------------------------------------------------------------------
New password: # set password
Re-type new password: # confirm
Adding password for user cent
----------------------------------------------------------------------------------------

[root@www ~]# systemctl restart httpd
[root@www ~]# mkdir /var/www/html/auth-basic
[root@www ~]# vi /var/www/html/auth-basic/index.html
----------------------------------------------------------------------------------------
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> Test Page for BasicAuth
</div>
---------------------------------------------------------------------------------------

Setelah itu akses situs http://ns.tkj.net/auth-basic

No comments:

Post a Comment