Apache2 picking up virtualhost but Lucee isnt

404 views
Skip to first unread message

James Chappell

unread,
Dec 14, 2015, 1:53:52 PM12/14/15
to Lucee
Hi All

I am evaluating Lucee as an alternative to getting us away from Adobe but I have run into a problem that after several hours of changes and service restarts I just cant resolve. I have googled this issue considerably and I am finding contradictory and ultimately ineffective solutions so I hope you guys can help.

I have installed Lucee on my dev machine (Ubuntu Mate 1404) and got it parsing .cfm files fine against the default website and got it creating the WEB-INF directory and parsing .cfm files fine. 

However, I cannot get it to work with any other VirtualHost. Apache recognises the virtualhost fine and renders its index.html but when I browse to my test index.cfm Lucee will only render the Lucee welcome screen HTML!  

I have noticed that
  • Lucee is not creating WEB-INF in the virtual host's folder
  • Apache is configured fine resources load fine
  • Lucee isnt working so ofc I get the welcome screen with no resources (because apache is mapped the site correctly and has no resources)
  • When I hit the site the tomcat logs dont change, no errors (ther than 404s) are logged by Apache
I have these configs
  • Lucee installed by the installer  lucee-4.5.2.018-pl0-linux-x64-installer.run
  • Lucee install folder: /opt/lucee
  • Lucee user "lucee"
  • webserver: Apache 2.4.7
  • server webroot: /var/www/
  • default webroot: /var/www/html
  • secondary test site: /var/www/dev-branch/site1
  • Lucee and Apache have been restarted and reloaded several dozen times
The lucee user is in the www-data groups.
The web folders are all owneed by www-data:wwww-data and for now have permissions 777 (just to eliminate permissions as a problem)

I have added virtual host configs to tomcat and Apache:

/opt/lucee/tomcat/conf/servers.xml
     <!-- ADD NEW HOSTS HERE -->
        <Host name="dev-branch" appBase="webapps"  unpackWARs="true" autoDeploy="true"
     xmlValidation="false" xmlNamespaceAware="false">
             <Context path="" docbase="/var/www/dev-branch/site1" />
    <Alias>dev-branch</Alias>
        </Host>


/etc/apache2/sites-enabled/dev-branch.conf
this file has been butchered together from several fixes I have read online :( 
<VirtualHost dev-branch:80>
        ServerAdmin webmaster@localhost
        ServerName dev-branch
        DocumentRoot /var/www/dev-branch/site1
        DirectoryIndex index.cfm
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/dev-branch/site1/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

                  ErrorLog ${APACHE_LOG_DIR}/www.domain.com-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
</VirtualHost>

I hope that is enough info!

Thanks for any help.

jvc



Jordan Michaels

unread,
Dec 14, 2015, 2:23:33 PM12/14/15
to lu...@googlegroups.com
Hi James,

This is still probably a permissions issue. You can tell for sure by checking your tomcat logs located in /opt/lucee/tomcat/logs/. The catalina.out file will be the file you want to look at first as it will show any errors when lucee goes to create the context. The fact that you're getting the rendered lucee page means that your connector is working, but your lack of a WEB-INF directory means your context isn't getting created.

If it were me, I'd just start by checking the catalina.out log and confirm that the problem is related to permissions when Lucee goes to create the context.

Hope this helps.

Kind regards,
Jordan Michaels


----- Original Message -----
From: "James Chappell" <jvcha...@gmail.com>
To: "Lucee" <lu...@googlegroups.com>
Sent: Monday, December 14, 2015 10:53:52 AM
Subject: [Lucee] Apache2 picking up virtualhost but Lucee isnt

Hi All

I am evaluating Lucee as an alternative to getting us away from Adobe but I
have run into a problem that after several hours of changes and service
restarts I just cant resolve. I have googled this issue considerably and I
am finding contradictory and ultimately ineffective solutions so I hope you
guys can help.

I have installed Lucee on my dev machine (Ubuntu Mate 1404) and got it
parsing .cfm files fine against the default website and got it creating the
WEB-INF directory and parsing .cfm files fine.

However, I cannot get it to work with any other VirtualHost. Apache
recognises the virtualhost fine and renders its index.html but when I
browse to my test index.cfm Lucee will only render the Lucee welcome screen
HTML!

I have noticed that

- Lucee is not creating WEB-INF in the virtual host's folder
- Apache is configured fine resources load fine
- Lucee isnt working so ofc I get the welcome screen with no resources
(because apache is mapped the site correctly and has no resources)
- When I hit the site the tomcat logs dont change, no errors (ther than
404s) are logged by Apache

I have these configs

- Lucee installed by the installer
lucee-4.5.2.018-pl0-linux-x64-installer.run
- Lucee install folder: /opt/lucee
- Lucee user "lucee"
- webserver: Apache 2.4.7
- server webroot: /var/www/
- default webroot: /var/www/html
- secondary test site: /var/www/dev-branch/site1
- Lucee and Apache have been restarted and reloaded several dozen times
--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
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+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/865c7e75-b965-439f-8e8a-aa4e6648a229%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hugo Ahlenius

unread,
Dec 15, 2015, 4:27:01 AM12/15/15
to lu...@googlegroups.com
James,

I would start to verify that everything is working as it should in Tomcat - e.g. skip Apache out of the equation, and browse using the tomcat port (8080 if you haven't changed it).

Regards,
Hugo

James Chappell wrote on 2015-12-14:
> Hi All
>
> I am evaluating Lucee as an alternative to getting us away from Adobe
> but I have run into a problem that after several hours of changes and
> service restarts I just cant resolve. I have googled this issue
> considerably and I am finding contradictory and ultimately ineffective
> solutions so I hope you guys can help.
>
> I have installed Lucee on my dev machine (Ubuntu Mate 1404) and got it
> parsing .cfm files fine against the default website and got it creating
> the WEB-INF directory and parsing .cfm files fine.
>
> However, I cannot get it to work with any other VirtualHost. Apache
> recognises the virtualhost fine and renders its index.html but when I
> browse to my test index.cfm Lucee will only render the Lucee welcome
> screen HTML!
>
> I have noticed that
>
> * Lucee is not creating WEB-INF in the virtual host's folder * Apache is
> configured fine resources load fine * Lucee isnt working so ofc I get
> the welcome screen with no resources (because apache is mapped the site
> correctly and has no resources) * When I hit the site the tomcat logs
> dont change, no errors (ther than 404s) are logged by Apache
>
> I have these configs
>
>
> * Lucee installed by the installer
> lucee-4.5.2.018-pl0-linux-x64-installer.run * Lucee install folder:
> /opt/lucee
>
> * Lucee user "lucee"
> * webserver: Apache 2.4.7
> * server webroot: /var/www/
> * default webroot: /var/www/html
> * secondary test site: /var/www/dev-branch/site1
>
> * Lucee and Apache have been restarted and reloaded several dozen times

Paul Klinkenberg

unread,
Dec 15, 2015, 6:51:15 AM12/15/15
to lu...@googlegroups.com
Hi Hugo,

In tomcat, you should try to set the docBase to "", and the path attribute to your context root, like so:
       <Host name="dev-branch" appBase="webapps"  unpackWARs="true"
autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
            <Context path="/var/www/dev-branch/site1" docbase="" />
   <Alias>dev-branch</Alias>
       </Host>

Also, the Alias tag is unnecessary in the given example, because it's the same as the Host name attribute..

Hope this helps, kind regards,

Paul Klinkenberg


Tomcat docs regarding the path attribute:
The context path of this web application, which is matched against the beginning of each request URI to select the appropriate web application for processing. All of the context paths within a particular Host must be unique. If you specify a context path of an empty string (""), you are defining the default web application for this Host, which will process all requests not assigned to other Contexts.

--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
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+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Paul Klinkenberg

unread,
Dec 16, 2015, 6:25:34 AM12/16/15
to lu...@googlegroups.com
Hi Hugo,

No news is good news?

Kind regards,

Paul Klinkenberg

------------


Hugo Ahlenius

unread,
Dec 17, 2015, 2:56:45 AM12/17/15
to lu...@googlegroups.com
Paul Klinkenberg wrote on 2015-12-16:
> Hi Hugo,
> No news is good news?
> Paul Klinkenberg

No news from, I am not the op - James Chapell is/was...

> Op 15 dec. 2015 om 12:51 heeft Paul Klinkenberg
> <pa...@ongevraagdadvies.nl <mailto:pa...@ongevraagdadvies.nl> > het
> volgende geschreven:
>
>
>
> Hi Hugo,
>
> In tomcat, you should try to set the docBase to "", and the path
> attribute to your context root, like so:
>
> <Host name="dev-branch" appBase="webapps" unpackWARs="true"
> autoDeploy="true" xmlValidation="false"
> xmlNamespaceAware="false"> <Context
> path="/var/www/dev-branch/site1" docbase="" />
>
> <Alias>dev-branch</Alias>
> </Host>
>
>
> Also, the Alias tag is unnecessary in the given example, because
> it's the same as the Host name attribute..
>
> Hope this helps, kind regards,
>
> Paul Klinkenberg
>
>
> Tomcat docs regarding the path attribute:
> The context path of this web application, which is matched
> against the beginning of each request URI to select the appropriate web
> application for processing. All of the context paths within a particular
> Host <https://tomcat.apache.org/tomcat-7.0-doc/config/host.html> must
> be unique. If you specify a context path of an empty string (""), you
> are defining the default web application for this Host, which will
> process all requests not assigned to other Contexts.
>
> Op 15 dec. 2015, om 10:25 heeft Hugo Ahlenius <frax...@oxel.net
> <mailto:frax...@oxel.net> > het volgende geschreven:
> <http://www.domain.com-error.log>
>
>
> # Possible values include: debug, info, notice,
> warn, error,
> crit, # alert, emerg. LogLevel warn
> </VirtualHost>
>
> I hope that is enough info!
>
>
> Thanks for any help.
>
>
> jvc
>
>
>
>
>
>
>
> -- Love Lucee? Become a supporter and be part of the Lucee project
> today! - http://lucee.org/supporters/become-a-supporter.html --- 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+un...@googlegroups.com
> <mailto:lucee+un...@googlegroups.com> . To post to this group,
> send email to lu...@googlegroups.com <mailto:lu...@googlegroups.com> .
> 00%24%40oxel.net. For more options, visit
> https://groups.google.com/d/optout.
>
>
>
>
>
> -- Love Lucee? Become a supporter and be part of the Lucee project
> today! - http://lucee.org/supporters/become-a-supporter.html --- 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+un...@googlegroups.com
> <mailto:lucee+un...@googlegroups.com> . To post to this group,
> send email to lu...@googlegroups.com <mailto:lu...@googlegroups.com> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lucee/80097E91-3188-41C5-88F2-E51C79AC
> 5708%40ongevraagdadvies.nl
> <https://groups.google.com/d/msgid/lucee/80097E91-3188-41C5-88F2-E51C79A
> C5708%40ongevraagdadvies.nl?utm_medium=email&utm_source=footer> . For

Paul Klinkenberg

unread,
Dec 17, 2015, 3:30:49 AM12/17/15
to lu...@googlegroups.com
Oow sorry :-/
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/111801d138a0%243f639a30%24be2ace90%24%40oxel.net.

James Chappell

unread,
Dec 18, 2015, 8:22:59 AM12/18/15
to Lucee
Thanks everyone for posting replies. I really appreciate you taking the time! I will look into your advice and definitely report back as soon as I can get back on it. 

Been fighting SOLR for the last couple of days :-/

James Chappell

unread,
Dec 18, 2015, 8:58:22 AM12/18/15
to Lucee
HI All,

I sorted it.

The problem was the hostname matching. In my server.xml there was no "localhost" default host. It was set to "127.0.0.1"...I dont know why I, I don't think I changed it. Also that default config had no CONTEXT tag (so all sites were defaulting to /var/www/)

So in server.xml I
  1. changed the name of the default host to "localhost"
  2. Added a context tag with a docBase attribute
 <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <Context path="" docBase="/var/www/html" />


Restart Lucee and boom. It is now picking up both sites: "dev-branch" and "localhost".

Excellent, now that I have virtual hosts I can try to get our app running :)

Thanks again for taking the time to reply :)

jvc


On Monday, 14 December 2015 18:53:52 UTC, James Chappell wrote:

James Chappell

unread,
Dec 18, 2015, 9:27:45 AM12/18/15
to Lucee
Sorry update on my fix...yeah that broke the admin panels.

So instead I reverted the default host to 127.0.0.1 and added a localhost virtualhost to server.xml.

Now both sites are up and I can access the admin panels.

Hopefully, thats it!
Reply all
Reply to author
Forward
0 new messages