Railo on Ubuntu, pages failing to load

334 views
Skip to first unread message

Pete

unread,
Jan 31, 2012, 8:34:22 AM1/31/12
to Railo
I'm not sure what I've done, but when I try to view a CFM page, the
browser seems to go into an infinite loading loop.

http://dev.willshawmedia.com.

LAMP is setup fine, as http://willshawmedia.com loads an old PHP page
fine...
I'm migrating across from a 1and1 VPS to a Rackspace Cloud, where I
didn't have a problem at all. But now I can't get any CFM pages to
load.

After installing Railo I briefly got into the administrator, and all
my CFM pages showed an error stating that the pages couldn't be found.
So I added the following to the tomcar server.xml file:

<Host name="dev.willshawmedia.com" appBase="webapps">
<Context path="" docBase="/var/www/vhosts/
willshawmedia.com/subdomains/dev/httpdocs/" />
</Host>

This then showed up as a context in the administrator.

And I've added this VirtualHost to the file in sites-available. I've
rebooted apache and railo.

<VirtualHost *:80>
ServerAdmin pe...@willshawmedia.com

ServerName dev.willshawmedia.com

DocumentRoot /var/www/vhosts/willshawmedia.com/subdomains/dev/
httpdocs
DirectoryIndex index.cfm
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/vhosts/willshawmedia.com/subdomains/dev/
httpdocs>
Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

I don't know where to go next from here... it worked much better last
time.

Jordan Michaels

unread,
Jan 31, 2012, 2:15:29 PM1/31/12
to ra...@googlegroups.com
How did you install? What connector method are you using?

Warm Regards,
Jordan Michaels

Pete

unread,
Jan 31, 2012, 3:09:42 PM1/31/12
to Railo
Ah I've made some progress, I installed the Mod_jk connector, and now
the pages don't time out infinitely! I just get a 500 internal server
error... which is probably easier to fix

On Jan 31, 1:34 pm, Pete <skea...@gmail.com> wrote:
> I'm not sure what I've done, but when I try to view a CFM page, the
> browser seems to go into an infinite loading loop.
>
> http://dev.willshawmedia.com.
>
> LAMP is setup fine, ashttp://willshawmedia.comloads an old PHP page
> fine...
> I'm migrating across from a 1and1 VPS to a Rackspace Cloud, where I
> didn't have a problem at all. But now I can't get any CFM pages to
> load.
>
> After installing Railo I briefly got into the administrator, and all
> my CFM pages showed an error stating that the pages couldn't be found.
> So I added the following to the tomcar server.xml file:
>
> <Host name="dev.willshawmedia.com" appBase="webapps">
>             <Context path="" docBase="/var/www/vhosts/
> willshawmedia.com/subdomains/dev/httpdocs/" />
> </Host>
>
> This then showed up as a context in the administrator.
>
> And I've added this VirtualHost to the file in sites-available. I've
> rebooted apache and railo.
>
> <VirtualHost *:80>
>     ServerAdmin p...@willshawmedia.com

Pete

unread,
Jan 31, 2012, 3:11:37 PM1/31/12
to Railo
I installed rail by downloading the .run file from getrailo.org

I thought the installer asked if I wanted to install an apache
connector whcih I said yes to... I can't remember.
However I just installed a mod_jk connector based on some blog posts I
found, which has stopped the time out and as I said is just returning
500 errors now.

So I'll check the tomcat and apache logs and see what's going on in
there.

On Jan 31, 7:15 pm, Jordan Michaels <jor...@viviotech.net> wrote:
> How did you install? What connector method are you using?
>
> Warm Regards,
> Jordan Michaels
>
> On 01/31/2012 05:34 AM, Pete wrote:
>
>
>
>
>
>
>
> > I'm not sure what I've done, but when I try to view a CFM page, the
> > browser seems to go into an infinite loading loop.
>
> >http://dev.willshawmedia.com.
>
> > LAMP is setup fine, ashttp://willshawmedia.comloads an old PHP page
> > fine...
> > I'm migrating across from a 1and1 VPS to a Rackspace Cloud, where I
> > didn't have a problem at all. But now I can't get any CFM pages to
> > load.
>
> > After installing Railo I briefly got into the administrator, and all
> > my CFM pages showed an error stating that the pages couldn't be found.
> > So I added the following to the tomcar server.xml file:
>
> > <Host name="dev.willshawmedia.com" appBase="webapps">
> >              <Context path="" docBase="/var/www/vhosts/
> > willshawmedia.com/subdomains/dev/httpdocs/" />
> > </Host>
>
> > This then showed up as a context in the administrator.
>
> > And I've added this VirtualHost to the file in sites-available. I've
> > rebooted apache and railo.
>
> > <VirtualHost *:80>
> >      ServerAdmin p...@willshawmedia.com

Jordan Michaels

unread,
Jan 31, 2012, 3:52:39 PM1/31/12
to ra...@googlegroups.com
Okay. If you installed with the installer there should be a mod_jk
config at the bottom of the Apache config file. Either
/etc/apache2/apache2.conf (ubuntu) or /etc/httpd/conf/httpd.conf (rhel).

The config also sets up a mod_jk log file that is set to log to the same
directory as your Apache logs.

/var/log/apache2/mod_jk.log (ubuntu) or /var/log/httpd/mod_jk.log (rhel)

I'd check that log or the Apache error log to see what's causing the
current 500 error.

HTH!

Warm Regards,
Jordan Michaels

Pete

unread,
Jan 31, 2012, 4:14:20 PM1/31/12
to Railo
Ok, if I do "tail -f" on the mod_jk.log, then refresh my page, I got
the following:

[Tue Jan 31 21:10:09.469 2012] [18577:140359759488864] [error]
jk_handler::mod_jk.c (2686): Could not find a worker for worker
name=ajp13

But I have no idea what that means. I'll put it into google and see
what happens... but if anyone has a clue, that'd be great :D
> >>> LAMP is setup fine, ashttp://willshawmedia.comloadsan old PHP page

Jordan Michaels

unread,
Jan 31, 2012, 4:40:43 PM1/31/12
to ra...@googlegroups.com
Sure. In mod_jk speak, a "worker" is just a name for an instance of
Tomcat. One of the features of mod_jk is that it can load balance across
multiple Tomcat instances, whether they exist on the same machine or
not. It's actually quite simple. I keep meaning to write up a tutorial
on how to do it but always end up putting time into other places - like
responding to mailing lists - lol!

At any rate, the one thing I should probably change about the
installer's methods is that it uses Tomcat's default worker, named
ajp13. This worker is only created when there's no worker config file
(workers.properties) and I'm guessing that you installing your own
version of mod_jk there was a workers.properties file.

I guess the question you should be asking yourself is if you wanted to
stick with the installer's mod_jk install or proceed configuring it
yourself. Either way will work and I'll be happy to help you, but you'll
need to pick one so they don't trample on each other.

Warm Regards,
Jordan Michaels

Pete

unread,
Jan 31, 2012, 4:43:56 PM1/31/12
to Railo
Ok I'm happy to go with the installer's, I was just trying to fix it
myself without bugging anyone but I've made a bit of a mess.

I've managed to track down a workers.properties file: /etc/libapache2-
mod-jk

Which contains this:

worker.list=ajp13_worker
worker.ajp13_worker.port=8009
worker.ajp13_worker.host=localhost
worker.ajp13_worker.type=ajp13
worker.ajp13_worker.lbfactor=1

I'm assuming it's something to with the fact that is "ajp13_worker",
and the error is looking for a worked called "ajp13"?

I found that file because in mods-enabled, the jk.conf file has this
line:

JkWorkersFile /etc/libapache2-mod-jk/workers.properties

Am I on the right track?
> >>>>> LAMP is setup fine, ashttp://willshawmedia.comloadsanold PHP page

Jordan Michaels

unread,
Jan 31, 2012, 4:56:10 PM1/31/12
to ra...@googlegroups.com
That's *exactly* the right track. =)

Now you just need to update the mod_jk config to apply to your CFML
requests.

Open the /etc/apache2/apache2.conf file and at the very bottom you'll
see this:

<IfModule mod_jk.c>
JkMount /*.cfm ajp13
JkMount /*.cfc ajp13
JkMount /*.do ajp13
JkMount /*.jsp ajp13
JkMount /*.cfchart ajp13
etc.....
</IfModule>

Change all those "ajp13's" to "ajp13_worker" and then restart Apache.

Your workers.properties file is already pointing to port 8009 which is
what Railo's Tomcat should be listening on.

If it doesn't work, we can do away with all the extra fluff and just
stick with the installer's config.

Let us know how it works!

Warm Regards,
Jordan Michaels

Pete

unread,
Jan 31, 2012, 5:08:26 PM1/31/12
to Railo
Aaah that makes some sort of sense! I was trying to find a reference
to ajp13 but I just didn't spot that there.
So is that connecting java and apache, and telling apache to launch a
cfm/cfc etc page using the ajp13_wroker instance of tomcat?

Any way, after doing all that, it's actually put me back at square
one. So what you've helped me do is repair my broken mod_jk
connector... thing.
So thanks!

I'm now back to pages that just not loading... I just get the browser
loading icon and no response. However I do get lots of tasty mod_jk
log entries...

[Tue Jan 31 22:05:35.018 2012] [21469:140376222902112] [info]
jk_open_socket::jk_connect.c (626): connect to 127.0.0.1:8009 failed
(errno=111)
[Tue Jan 31 22:05:35.018 2012] [21469:140376222902112] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (1008): Failed opening socket
to (127.0.0.1:8009) (errno=111)
[Tue Jan 31 22:05:35.018 2012] [21469:140376222902112] [error]
ajp_send_request::jk_ajp_common.c (1630): (ajp13_worker) connecting to
backend failed. Tomcat is probably not started or is listening on the
wrong port (errno=111)
[Tue Jan 31 22:05:35.019 2012] [21469:140376222902112] [info]
ajp_service::jk_ajp_common.c (2607): (ajp13_worker) sending request to
tomcat failed (recoverable), because of error during request sending
(attempt=1)
[Tue Jan 31 22:05:35.119 2012] [21469:140376222902112] [info]
jk_open_socket::jk_connect.c (626): connect to 127.0.0.1:8009 failed
(errno=111)
[Tue Jan 31 22:05:35.119 2012] [21469:140376222902112] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (1008): Failed opening socket
to (127.0.0.1:8009) (errno=111)
[Tue Jan 31 22:05:35.119 2012] [21469:140376222902112] [error]
ajp_send_request::jk_ajp_common.c (1630): (ajp13_worker) connecting to
backend failed. Tomcat is probably not started or is listening on the
wrong port (errno=111)
[Tue Jan 31 22:05:35.119 2012] [21469:140376222902112] [info]
ajp_service::jk_ajp_common.c (2607): (ajp13_worker) sending request to
tomcat failed (recoverable), because of error during request sending
(attempt=2)
[Tue Jan 31 22:05:35.119 2012] [21469:140376222902112] [error]
ajp_service::jk_ajp_common.c (2626): (ajp13_worker) connecting to
tomcat failed.
[Tue Jan 31 22:05:35.119 2012] [21469:140376222902112] [info]
jk_handler::mod_jk.c (2678): Service error=-3 for worker=ajp13_worker

Oh and by the way I've just found out who you are Jordan, you're a
Railo genius! So if you happen to be at Scotch on the Rocks this year,
I'll have to buy you a pint to say thanks for your help.
> >>>>>>> LAMP is setup fine, ashttp://willshawmedia.comloadsanoldPHP page

Pete

unread,
Jan 31, 2012, 5:38:20 PM1/31/12
to Railo
Ok... so these entries:

connect to 127.0.0.1:8009 failed (errno=111)
Tomcat is probably not started or is listening on the wrong port

Makes me wonder if I've got tomcat setup wrong. If I run netstat I get
the following:

tcp6 0 0 :::8888 :::*
LISTEN 21568/java
tcp6 0 0 127.0.0.1:8005 :::*
LISTEN 21568/java
tcp6 0 0 :::8009 :::*
LISTEN 21568/java

Also I've check in my server.xml for tomcat, and I've got this inside
a <Service name="Catalina"> tag:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

That's all inside the "<Server port="8005" shutdown="SHUTDOWN">" tag.

I'm not going to lie and pretend I fully understand ports.

Jordan Michaels

unread,
Jan 31, 2012, 5:54:11 PM1/31/12
to ra...@googlegroups.com
Nah, that setup looks good. I'm guessing there's a firewall in the way.

You can test the connection to port 8009 using "telnet" from within Ubuntu:

$ telnet localhost 8009
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

If you don't get the above, something is blocking you. If you DO get the
above, then good. =) You can exit this interface by hitting CTRL+], then
Enter, and you'll be dumped to the "telnet" prompt:

telnet> _

Type "quit" to exit telnet.

What happens when you type this below?

$ sudo iptables -L

you'll be prompted for your password but then you hopefully be shown
your firewall config. If you have a firewall in place, but aren't
allowing connections from localhost to 8009, then that's the problem
right there. ;)

Hope this helps!

Warm Regards,
Jordan Michaels

Pete

unread,
Jan 31, 2012, 5:58:21 PM1/31/12
to Railo
Ah that sounds promising. telnet worked fine. This is the output from
iptables

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

So do I need to put my port in there somewhere?

Thanks for this Jordan, I'd almost given up for the night.
> ...
>
> read more »

Jordan Michaels

unread,
Jan 31, 2012, 6:07:37 PM1/31/12
to ra...@googlegroups.com
telnet works fine? That's odd. Did you use localhost or 127.0.0.1? Those
can be different sometimes.

Try:

$ telnet 127.0.0.1 8009

Still work okay?

Warm Regards,
Jordan Michaels

>> read more �

Pete

unread,
Jan 31, 2012, 6:10:48 PM1/31/12
to Railo
Yup, works fine:

/home/pete/# sudo telnet 127.0.0.1 8009
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^]

telnet> quit
Connection closed.

Same thing for telnet localhost 8009
> ...
>
> read more »

Pete

unread,
Jan 31, 2012, 6:12:36 PM1/31/12
to Railo
Hmm I'm getting this error when I reboot apache. It's not affecting my
apache sites so I kind of thought nothing of it:

apache2: Could not reliably determine the server's fully qualified
domain name, using 164.177.156.23 for ServerName

That couldn't be causing a problem could it? I should have thought of
that earlier
> ...
>
> read more »

Jordan Michaels

unread,
Jan 31, 2012, 6:18:27 PM1/31/12
to ra...@googlegroups.com
Nah, that's a benign Apache error. It just doesn't know what it should
call itself. You can fix it by naming it or mapping the IP to a domain,
but it doesn't really matter either way.

I admit I'm a little stumped right now. If you're able to connect to it
from the command line, then mod_jk should be able to connect to it as well.

I wonder if there's some aspect of the config I'm not considering. Would
you be willing to tell me what tutorial you used to install mod_jk?
Maybe that'll give us some leads.

Warm Regards,
Jordan Michaels

>> read more �

Pete

unread,
Jan 31, 2012, 6:24:28 PM1/31/12
to Railo
Yeah, although do you think re-running the railo installer might fix
it?

I used this command to install it: apt-get install libapache2-mod-jk
I've opened and closed dozens of tabs though since I did that hours
ago, so I'm not sure where the tutorial I got that from is.
I tried to create a /etc/apaches/workers.properties file, but when I
updated the http.conf to point to it, I got errors about having 2
files, so I undid all that.

That probably doesn't help much.
> ...
>
> read more »

Jordan Michaels

unread,
Jan 31, 2012, 7:14:41 PM1/31/12
to ra...@googlegroups.com
Re-running the install script would re-apply the original connector
config, sure, but it sounded like that didn't work when you did it
originally.

Can we make sure you're working with a fresh copy of the logs? Try
removing the mod_jk.log file and restarting Apache. That should create a
fresh log file for you,

If you were tailing it, then this won't help one bit, but I want to make
sure that Tomcat is NOT able to access the AJP port while at the same
time you can access it just fine via telnet. That part totally confuses me.

Thanks!

Warm Regards,
Jordan Michaels

>> read more �

Pete

unread,
Feb 3, 2012, 3:50:57 AM2/3/12
to Railo
Sorry I've not got round to replying yet.
Anyway, I've delete the log file, stopped apache, rebooted railo, then
started apache, and this is what mod_jk.log says now (after I tried to
access my url):

[Fri Feb 03 08:48:54.272 2012] [30673:139834399471456] [info]
init_jk::mod_jk.c (3252): mod_jk/1.2.32 () initialized
[Fri Feb 03 08:48:54.273 2012] [30673:139834399471456] [error]
uri_worker_map_ext::jk_uri_worker_map.c (506): Could not find worker
with name 'jk-manager' in uri map post processing.
[Fri Feb 03 08:48:54.273 2012] [30673:139834399471456] [error]
uri_worker_map_ext::jk_uri_worker_map.c (506): Could not find worker
with name 'jk-status' in uri map post processing.
[Fri Feb 03 08:48:54.294 2012] [30674:139834399471456] [info]
init_jk::mod_jk.c (3252): mod_jk/1.2.32 () initialized
[Fri Feb 03 08:48:54.294 2012] [30674:139834399471456] [error]
uri_worker_map_ext::jk_uri_worker_map.c (506): Could not find worker
with name 'jk-manager' in uri map post processing.
[Fri Feb 03 08:48:54.294 2012] [30674:139834399471456] [error]
uri_worker_map_ext::jk_uri_worker_map.c (506): Could not find worker
with name 'jk-status' in uri map post processing.

Pete
> ...
>
> read more »

Pete

unread,
Feb 10, 2012, 6:08:18 AM2/10/12
to Railo
I kind of gave up on this. I was trying to do this all on Ubuntu
11.10, which I had trouble installing apache on. When I switched back
to 10.04, everything installed fine.
I've got the Railo administrator up and running fine... I have a
different problem now with that, but I've given up on Ubuntu 11.10.

Thanks for your help anyway Jordan


On Feb 1, 12:14 am, Jordan Michaels <jor...@viviotech.net> wrote:
> ...
>
> read more »

Jordan Michaels

unread,
Feb 10, 2012, 1:28:51 PM2/10/12
to ra...@googlegroups.com
No problem Pete. It was getting a bit frustrating. ;)

Warm Regards,
Jordan Michaels

Robert Munn

unread,
Feb 10, 2012, 2:16:19 PM2/10/12
to Railo
I had a similar problem installing Railo on Ubuntu 11.10 a couple of
days ago. I installed Tomcat6 from Synaptic and added the Apache
Tomcat mod_jk connector from Synaptic, then dropped the railo war into
Tomcat and made it the ROOT folder once it was exploded. What I found
was that when I added mod_jk from Synaptic, the system installed the
module config and load statement in /etc/apache2/mods-available, and
the config included settings for mod_jk that did not work with Railo.
I got to the 500 error stage, then the 503 error stage, but I never
solved the problem. Rather than spin my wheels on it, I uninstalled
Tomcat and mod_jk and installed Railo in /opt/railo from the .run
file (with sudo) to get it working. I'm still having a problem with
BlazeDS, but everything else appears to be ok.

It is worth noting that I have a 10.10 desktop install that has been
upgraded rather than a clean 11.10 install.
Reply all
Reply to author
Forward
0 new messages