Apache2 Basic Authentication

Serhan Balcı
Feb 24, 2017 · 1 min read

sites-available altında oluşturduğumuz conf dosyasının içerisine aşağıda ki kod bloğunu ekliyoruz.

<Directory "/var/www/html/protected">
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/etc/htpasswd/.htpasswd"
Require valid-user
Order allow,deny
Allow from all
</Directory>

daha sonra yeni bir htpasswd kullanıcısı oluşturuyoruz.

htpasswd /etc/htpasswd/.htpasswd admin

bize admin kullanıcısı için parola soracaktır ve yazdığımız parolayı hash’leyerek sistemde saklayacaktır.


son olarak şifre koruması uyguladığımız siteye erişmeye çalıştığımızda aşağıda ki gibi bize kullanıcı adı ve parola soracaktır.

serhanbalci

13 years of professional experience & knowledge about software development.

Serhan Balcı

Written by

Software Development Manager

serhanbalci

13 years of professional experience & knowledge about software development.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade