【发布时间】:2017-03-24 12:37:37
【问题描述】:
我将 apache 与 Lucee (tomcat) 一起使用。我有一个我想要在基本身份验证后面的开发站点。我有 apache 配置和非 ColdFusion 页面需要并提示进行身份验证。当我导航到 CF 页面时,不需要基本身份验证。
我需要修改哪些 Tomcat / Lucee 配置文件才能在设置附加基本身份验证时使用 apache 基本身份验证?
我正在运行 Apache/2.4.10 (Debian)
这是我的网站配置文件:
<VirtualHost *:80>
ServerName dev.mysite.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/mysite.com/dev/docroot
<Directory /var/www/mysite.com/dev>
Options Indexes FollowSymLinks
AllowOverride All
AuthName "Secured Development Environment"
AuthType Basic
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
DirectoryIndex index.cfm index.html
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
这是 Lucee 添加到我的 apache2.conf 文件中的内容
<IfModule mod_proxy.c>
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+\.cfchart)(/.*)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+\.cfml)(/.*)?$ http://127.0.0.1:8888/$1$2
# optional mappings
#ProxyPassMatch ^/flex2gateway/(.*)$ http://127.0.0.1:8888/flex2gateway/$1
#ProxyPassMatch ^/messagebroker/(.*)$ http://127.0.0.1:8888/messagebroker/$1
#ProxyPassMatch ^/flashservices/gateway(.*)$ http://127.0.0.1:8888/flashservices/gateway$1
#ProxyPassMatch ^/openamf/gateway/(.*)$ http://127.0.0.1:8888/openamf/gateway/$1
#ProxyPassMatch ^/rest/(.*)$ http://127.0.0.1:8888/rest/$1
ProxyPassReverse / http://127.0.0.1:8888/
</IfModule>
这是我根据推荐的更新配置
我根据您的建议更新了配置,但没有解决问题。
<VirtualHost *:80>
ServerName dev.mysite.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/mysite.com/dev/docroot
<Directory /var/www/mysite.com/dev>
Options Indexes FollowSymLinks
AllowOverride All
AuthName "Secured Development Environment"
AuthType Basic
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
DirectoryIndex index.cfm index.html
</Directory>
<IfModule mod_proxy.c>
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+\.cfchart)(/.*)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+\.cfml)(/.*)?$ http://127.0.0.1:8888/$1$2
ProxyPassReverse / http://127.0.0.1:8888/
</IfModule>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
这不起作用,我不确定它有什么不同,因为虚拟主机包含在 IfModule 之前
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
【问题讨论】:
-
请添加您的 Apache 配置,了解如何将 CF 页面的请求发送到 Tomcat 以及如何将虚拟主机发送到上述内容。如果不知道你做了什么,就不可能说它为什么不工作,但这不是 Tomcat/Lucee 的问题,这将与你如何配置 Apache 有关。
标签: tomcat authentication coldfusion lucee