«

»

Mar 14

Apache Dizinine Şifreli Giriş

sudo htpasswd -c /etc/apache2/.htpasswd kullanıcı ile login yapıcak kullanıcı belirlenir.

sudo nano /etc/apache2/sites-enabled/000-default.conf dosyasına alttaki satırlar eklenir.

Kod:
<Directory "/var/www/html">[/color][/font][/color]
AuthType Basic

AuthName "Restricted Content"

AuthUserFile /etc/apache2/.htpasswd

Require valid-user
[color=#3a3a3a][font=monospace][color=#000000] </Directory>

sudo apache2ctl configtest yapılan değişiklerle sorun oluştumu check et.

sudo systemctl restart apache2  servisi yeniden başlat ve durumunu kontrol et.
sudo systemctl status apache2

sudo nano /var/www/html/.htaccess  erişim yetkilerini belirlemek için oluştur ve alttaki satırları ekle.

Kod:
AuthType Basic[/font][/color]
[color=#3a3a3a][font=monospace]AuthName "Restricted Content"[/font][/color]
[color=#3a3a3a][font=monospace]AuthUserFile /etc/apache2/.htpasswd[/font][/color]
[color=#3a3a3a][font=monospace]Require valid-user

sudo systemctl restart apache2  servisi yeniden başlat ve durumunu kontrol et.

sudo systemctl status apache2

Bir Cevap Yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

AlphaOmega Captcha Classica  –  Enter Security Code
     
 

Şu HTML etiketlerini ve özelliklerini kullanabilirsiniz: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>