Outils pour utilisateurs

Outils du site


linux:apache-proxy

Serveur Apache Proxy avec authentification

  1. Installer les utilitaires:
    apt install apache2 apache2-utils
  2. Editer le fichier d'apache
    nano /etc/apache2/sites-enables/000...

    et y modifier le contenu de la sorte

    <VirtualHost *:80>
        ProxyPreserveHost On
    
        ProxyPass / http://serverlocal:port/
        ProxyPassReverse / http://serverlocal:port/
    
        Timeout 5400
        ProxyTimeout 5400
    
        ServerName server
    
        <Proxy *>
            Order deny,allow
            Allow from all
            Authtype Basic
            Authname "Password Required"
            AuthUserFile /etc/apache2/.htpasswd
            Require valid-user
        </Proxy>
    </virtualhost>
  3. Créer un utilisateur
    htpasswd -c /etc/apache2/.htpasswd <utilisateur>
  4. Activer les modules apache
    a2enmod proxy
    a2enmod proxy_http
  5. Redémarrer apache
    service apache2 restart
linux/apache-proxy.txt · Dernière modification : de root