Tabela de conteúdos

Apache HTTP Auth

2.2

<Directory "/var/www/site1/">
    AuthType Basic
    AuthName "Acesso ao Meu Site"
    AuthUserFile /etc/httpd/auth/users
    Require valid-user
    #Require user "userFulano"
</Directory>

2.4

<Directory "/var/www/site1/">
    AuthType Basic
    AuthName "Acesso ao Meu Site"
    AuthBasicProvider file
    AuthUserFile /etc/httpd/auth/users
    Require valid-user
    #Require user "userFulano"
</Directory>

PHP-FPM

<VirtualHost *>
   ServerName auth.dev
   DocumentRoot "/var/www/auth"
   ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:3101/var/www/html/app/public/$1
   SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
</VirtualHost>