apache2 and lucee within ubuntu

677 views
Skip to first unread message

Stéphane MERLE

unread,
Apr 9, 2015, 11:16:22 AM4/9/15
to lu...@googlegroups.com
Hi,

I set up my first ubuntu host for lucee ... (I was using windows and railo for now), and I don't get how to have the port 80 to respond !

everything works perfectly on port 8888
I got apache2 listening on port 80

I setup the apache like that :

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

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

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet



I am assuming that I need to change something here, but I have no clue on what ... and cannot find info on the lucee site ....

Can you point me in the right direction .... ?

Thanks !

Stéphane



Amarius von Tres

unread,
Apr 9, 2015, 11:21:15 AM4/9/15
to lu...@googlegroups.com
Prozesses on port 80 on *nix Systems needs specials privileges. Try to run the java webcontainer(tomcat) under root rights. 

Stéphane MERLE

unread,
Apr 9, 2015, 11:23:24 AM4/9/15
to lu...@googlegroups.com


Le jeudi 9 avril 2015 17:21:15 UTC+2, Amarius von Tres a écrit :
Prozesses on port 80 on *nix Systems needs specials privileges. Try to run the java webcontainer(tomcat) under root rights. 


I think I need to tell somewhere to apache that it need to proxy to tomcat on 8888 ...

Or I could just change server.xml to use 80 instead of 8888 but I thought that apache was better to handle the front-end ?

Stéphane


 

Terry Whitney

unread,
Apr 9, 2015, 3:11:14 PM4/9/15
to lu...@googlegroups.com
Ubuntu is a hot mess as it does not conform to enterprise standards.



the real question is, are you trying to get apache to respond and then connect to the request on lucee or do you just want it to run on port 80?

Seth Johnson

unread,
Apr 9, 2015, 7:41:01 PM4/9/15
to lu...@googlegroups.com
Hi,

Did you add your site to tomcat's server.xml file?  Is the WEB-INF folder being generated in your site?  Did you run a2ensite and then reload apache service after adding the site in Apache?  

I did the same thing yesterday on an AWS server, and followed this guide replacing the Railo parts with Lucee. 


Seth

--
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/4e85634b-bd9b-4ad5-9973-890026b9d157%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Stéphane MERLE

unread,
Apr 10, 2015, 4:43:11 AM4/10/15
to lu...@googlegroups.com


Le jeudi 9 avril 2015 21:11:14 UTC+2, Terry Whitney a écrit :
Ubuntu is a hot mess as it does not conform to enterprise standards.



the real question is, are you trying to get apache to respond and then connect to the request on lucee or do you just want it to run on port 80?


euuu I thought I had no choice but to get apache to answer on port 80 and to forward request up to lucee .... (like IIS on windows)
I don't really care ... I will probably set a pair of nginx as LoadBalancer in front and forward the requests to 2 fronts with lucee (on port 80) so I can easely forget apache if needed....

Stéphane


Stéphane MERLE

unread,
Apr 10, 2015, 5:08:04 AM4/10/15
to lu...@googlegroups.com
I found my way here : https://github.com/getrailo/railo/wiki/Installation-apache

I used Simple Proxy way ...

Thanks everyone !!

Stéphane

--
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/psw0ztoqQFQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

Stéphane MERLE

unread,
Apr 15, 2015, 9:03:03 AM4/15/15
to lu...@googlegroups.com
Hi,
I am back on this matter as I discovered that this was not working on subfolders and that I would need to set each subfolders manually ....

if I call the url with :8888 it's working perfectly but if I call with :80 so going thrue apache I got errors or timeout

I decided to go for one of the other solutions of the page  https://github.com/getrailo/railo/wiki/Installation-apache and finished with this apache error :

AH01144: No protocol handler was valid for the URL /monitoring/test.cfm. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule

with this kind of apache conf file :
<Proxy *>
Allow from all
</Proxy>
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ http://localhost:8888/$1$2
#Uncomment the above to handle HTTP (such as with Jetty) rather than AJP


<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName www.example.com
        ServerAlias example.com
       
        DocumentRoot /home/www/site/


        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn
        LogLevel info

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

and I've modified the server.xml file with this add :
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
     <Context path="" docBase="/home/www/site" />
     <Alias>www.example.com</Alias>
     <Alias>example.com</Alias>
   
     <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
     <Valve className="mod_cfml.core" loggingEnabled="false" waitForContext="10" />
</Host>


I did install the mod proxy and proxy_http

I would appreciate some help ....

Thanks,
Stéphane
To unsubscribe from this group and all its topics, send an email to lucee+unsubscribe@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

Jon Clausen

unread,
Apr 15, 2015, 10:07:43 AM4/15/15
to lu...@googlegroups.com
You don’t need the ProxyPassMatch directive to :8009 - only to :8888

Just this one:
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ http://127.0.0.1:8888/$1$2

Apache will fire the first ProxyPassMatch directive that matches the conditions so, in your case, the ProxyPassMatch to :8888 is never being evaluated as the call to :8009 matches for all .cfm/.cfc.   
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.

Stéphane MERLE

unread,
Apr 15, 2015, 10:11:25 AM4/15/15
to lu...@googlegroups.com
AND THE WINNER IS JON !!

you are totally right !

Thanks for your help !

Stéphane
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

Jon Clausen

unread,
Apr 15, 2015, 10:26:03 AM4/15/15
to lu...@googlegroups.com

No problem. I see you’re planning on using NGINX in front of Apache for balancing. Unless you need something specific with Apache, you could also accomplish the same directly through NGINX and skip using Apache altogether:

upstream lucee {
        server          127.0.0.1:8888;
        #add more server blocks here for load balancing
    }
location ~* ^.+\.(jpe?g|jpg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3|ttf|woff)$  
{
        root   /var/www/mywebroot;
            expires 30d;
}


location ~ \.(cfm|cfml|cfc|jsp|cfr)(.*)$ {
        proxy_pass http://lucee;
        proxy_http_version  1.1;
        proxy_set_header    Connection "";
        proxy_set_header    Host                $host;
        proxy_set_header    X-Forwarded-Host    $host;
        proxy_set_header    X-Forwarded-Server  $host;
        proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Proto   $scheme;
        proxy_set_header    X-Real-IP           $remote_addr;
        expires             epoch;
    }

Make sure to add your remote IP valve in server.xml:

<Valve className="org.apache.catalina.valves.RemoteIpValve"  />

If you need rewrite rules there are a few online converters that will do a far job of converting those to NGINX syntax.

Reply all
Reply to author
Forward
0 new messages