Enable Basic Authentication in Lucee (tomcat) with Apache

119 views
Skip to first unread message

Mathew Olsen

unread,
Mar 24, 2017, 5:49:53 PM3/24/17
to Lucee
I'm reposting this question here, I'm missing something. My basic authentication works for requests not getting sent to tomcat, but not working for ColdFusion pages. 

What Tomcat / Lucee config file do I need to modify to either use the apache basic authentication on setup additional basic authentication?


I'm running Apache/2.4.10 (Debian) Here's my site config file:


<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>

Here's what Lucee Added to my apache2.conf file

<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>

Andrew Dixon

unread,
Mar 24, 2017, 6:43:18 PM3/24/17
to lu...@googlegroups.com
Hi Matthew,

The requests are getting proxied off to Tomcat before they hit your VirtualHost. Move the <IfModule> stuff into the <VirtualHost> after the <Directory> definition. You will need to do this for each Virtual Host, so you might want to pop it into a separate file and then include in using the Include directive.

Kind regards,

Andrew

--
**Ann: the mailing list is being migrated to the Lucee Dev forum at https://dev.lucee.org**
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/1e1ec84c-4e03-4d24-82ec-c38e12a8928d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages