.htaccess nudar file konfigurasaun ne'ebe fornesidu husi servidor web Apache, utilizadu para modifika fungsaun default Apache. Ida husi fungsaun .htaccess mak hanesan proteja diretoriu web, hodi nune'e wainhira asesu ba diretoriu web refere liu aplikasaun browser, tenki hatama lai username no password.
Notas:
Pratika ne'e Autores teste iha Apache versaun 2.4.7 ho sistema operasaun Linux Mint 17.1 "Rebecca".
Tuir mai lalaok oinsa proteja diretoriu web ho .htaccess:
- Loke aplikasaun Terminal liu husi menu: System Tools → Terminal
- Kria file .htpasswd para rai username no password ho maneira:
sudo htpasswd -c /etc/apache2/.htpasswd admin
Notas:
Bele troka "admin" ho naran saida deit.
-
Kontinua kria file .htaccess iha diretoriu web ne'ebe hakarak ita proteja.
sudo nano /var/www/html/.htaccess
Notas:
Iha ezemplu ne'e Autores aplika ba diretoriu default servidor web Apache (/var/www/html).
No hatama parametru tuir mai ne'e:
AuthType Basic AuthName "Restricted Files" AuthBasicProvider file AuthUserFile /etc/apache2/.htpasswd Require valid-user
sudo nano /etc/apache2/apache2.confBuka parametru iha kraik ne'e:
<Directory /var/www/> Options FollowSymLinks AllowOverride None Require all granted </Directory>Modifika parametru refere hanesan tuir mai:
<Directory /var/www/> Options FollowSymLinks AllowOverride Authconfig Require all granted </Directory>
sudo service apache2 restartou
sudo /etc/init.d/apache2 restart
Janela Autentikasaun Iha Browser Mozilla Firefox |
Referensia:
Oinsa Utiliza Editor Testu Nano?
Maneira Fasil Instala LAMP iha Linux Mint 17
This article very helpful!
ReplyDelete(h)
Fahe nafatin tutorial liu husi blog ne
ReplyDeletecheer
obrigado ba matadalan ne bro
ReplyDeleteFurak!!!
ReplyDelete