AddExternalAuth pwauth /usr/sbin/pwauth
SetExternalAuthMethod pwauth pipe
<Directory /var/www/html/wacs>
    SSLRequireSSL
    AuthType Basic
    AuthName "PAM Authentication"
    AuthBasicProvider external
    AuthExternal pwauth
    require valid-user
</Directory>
# --------------------------------------------------------------------------- Escritorio / Owncloud ---------------------------------------------------------
<VirtualHost *:80>
        ServerAdmin suporte@mesmo.pt
        ServerName escritorio.mywacs.mesmo.pt

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        Redirect / https://escritorio.mywacs.mesmo.pt/
        ProxyPassReverse / https://escritorio.mywacs.mesmo.pt/

</VirtualHost>

 <VirtualHost *:443>

ServerName escritorio.mywacs.mesmo.pt

SSLEngine on

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
        ProxyPass / http://escritorio.mywacs.mesmo.pt/
        ProxyPassReverse / https://escritorio.mywacs.mesmo.pt/

SSLCertificateFile /home/administrator/certificados/escritorio/escritorio.mywacs.mesmo.pt-cert.crt
SSLCertificateKeyFile /home/administrator/certificados/escritorio/escritorio.mywacs.mesmo.pt-private-key.pem

</VirtualHost>
# --------------------------------------------------------------------------- Escritorio Virtual ---------------------------------------------------------
<VirtualHost *:80>
        ServerAdmin suporte@mesmo.pt
        ServerName escritoriovirtual.mywacs.mesmo.pt

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

            ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

        ProxyPass / http://escritoriovirtual.mywacs.mesmo.pt/
        ProxyPassReverse / http://escritoriovirtual.mywacs.mesmo.pt/

<Location />
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>
# --------------------------------------------------------------------------- Supervisao ---------------------------------------------------------------
<VirtualHost *:80>
        ServerAdmin suporte@mesmo.pt
        ServerName supervisao.mywacs.mesmo.pt

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        Redirect / https://supervisao.mywacs.mesmo.pt/

</VirtualHost>

<VirtualHost *:443>
        ServerAdmin suporte@mesmo.pt
        ServerName supervisao.mywacs.mesmo.pt

        SSLEngine on

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

            ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

        ProxyPass / http://supervisao.mywacs.mesmo.pt/
        ProxyPassReverse / https://supervisao.mywacs.mesmo.pt/

SSLCertificateFile /home/administrator/certificados/supervisao/supervisao.mywacs.mesmo.pt-cert.crt
SSLCertificateKeyFile /home/administrator/certificados/supervisao/supervisao.mywacs.mesmo.pt-private-key.pem

</VirtualHost>
# -------------------------------------------------------------------------- Adv Gestao -------------------------------------------------------------
<VirtualHost *:80>
        ServerAdmin suporte@mesmo.pt
        ServerName wacs.mywacs.mesmo.pt

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        Redirect / https://wacs.mywacs.mesmo.pt/
	ProxyPassReverse / https://wacs.mywacs.mesmo.pt/

</VirtualHost>

<VirtualHost *:443>
        ServerAdmin suporte@mesmo.pt
        ServerName wacs.mywacs.mesmo.pt

        SSLEngine on

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

            ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

        ProxyPass / http://wacs.mywacs.mesmo.pt/
        ProxyPassReverse / https://wacs.mywacs.mesmo.pt/

SSLCertificateFile /home/administrator/certificados/wacs/wacs.mywacs.mesmo.pt-cert.crt
SSLCertificateKeyFile /home/administrator/certificados/wacs/wacs.mywacs.mesmo.pt-private-key.pem

</VirtualHost>
# --------------------------------------------------------------------------- http-ejabberd ------------------------------------------------------------
