在Apahce上启用代理之前的登录功能

时间:2018-11-16 03:55:42

标签: linux apache login proxy httpd.conf

我正在尝试为我的研究小组托管一个开放源Web应用程序。 我当前正在使用apache代理将该Web应用程序重定向到SSL的端口443。 原始Web应用程序在端口9974(随机保护)上运行。 我正在使用Apache将其重新路由到端口443

但是,在代理发生之前,我很难启用登录页面。 只有代理可以正常工作。 我尝试了多种方法,但这是我目前正在测试的方法。

我想做什么。 1.用户点击登录页面(login.html)(使用Errordocument) 2.登录后,Apache重新路由到Web应用程序 ```

    <VirtualHost *:443>
       ServerName webapp.example.com
       ServerAlias webapp
       ServerAdmin me

       SSLEngine On
       SSLProtocol all -SSLv2 -SSLv3 -TLSv1
       SSLHonorCipherOrder on
       SSLCertificateFile /data/certs/webapp.cer
       SSLCACertificateFile /data/certs/Root.cer
       SSLCACertificatePath /data/certs/
       SSLCertificateKeyFile /data/certs/webapp.key

    <Location />
       Require valid-user
       ErrorDocument 401 /usr/lib/python3.6/site-packages/webapp/serve/login.html

       AuthName "webapp"
       AuthType Form
       AuthFormProvider ldap
       AuthLDAPURL "ldaps://ldap.ldap.ldap.com/DC=ldap,DC=ldap,DC=com?sAMAccountName?sub?(objectClass=*)" SSL

       AuthLDAPBindDN "svc.webapp"
       AuthLDAPBindPassword "password"

       AuthLDAPGroupAttributeIsDN on
       Require ldap-group CN=Group_test,OU=ldap,OU=ldap Groups,DC=ldap,DC=ldap,DC=com

       Session On
       SessionCryptoPassphrase Supa!securePassword2SecureDaUzzer!@2K15
       SessionCookieName ldap path=/;
       SessionMaxAge 43200
    </Location>

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

    ProxyPreserveHost On
    ProxyPass / http://webapp.example.com:9974/
    ProxyPassReverse / http://webapp.example.com:9974/

    </VirtualHost>

```

我在下面遇到401错误

未经授权   该服务器无法验证您是否有权访问文档   要求。您提供的凭据错误(例如密码错误),或者   您的浏览器不了解如何提供所需的凭据。

此外,尝试使用401时遇到401未经授权的错误   ErrorDocument处理请求。

0 个答案:

没有答案