Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
8559 Vistas

Hello,

I want to configure the htaccess for my server, so when any one clic on the my_domaine:8069/web 

he give me popup asking for

htaccess (login, password)

i work with vps server with ubuntu as OS

Avatar
Descartar
Mejor respuesta

Hello

If you have set the .htaccess file for apache2  you need to set .htaccess password file. below is the sample code to use in .htaccess.


#set an environtment variable "auth" if the request starts with "/web" 
SetEnvIf Request_URI ^/web auth=1
AuthName "Please login to access backend!"
AuthType Basic AuthUserFile "/pathtoyour.htpasswd"
 
Order Allow,Deny
Satisfy any
Allow from all
Require valid-user
# then, deny only if required
Deny from env=auth
Avatar
Descartar
Autor

Thank youk kazim , can you explain more i have a vps server on it i install only the odoo !! how i should process ?

Autor

OS is ubuntu

You just need to add one file in /var/www/html folder Go to that folder and run command sudo nano .htaccess and then you need to place basic htaccess contains there you can use this http://www.htaccessredirect.net/ to generate it easily .

Autor

I make my files under /var/www/html with this structure: FOR HTACCESS FILE #set an environtment variable "auth" if the request starts with "/web" SetEnvIf Request_URI ^/web auth=1 AuthName "Please login to access !" AuthType Basic AuthUserFile "/var/www/html/.htpasswd" Order Allow,Deny Satisfy any Allow from all Require valid-user # then, deny only if required Deny from env=auth FOR HTPASSWD aymen:kPMZE4nuXggHA But nothing is changed !! i don't know the pb excatly can you correct me Sir !

Autor

i should activate the apache server or no ?