Getting tomcat (or equiv) to run on port 80...

Hello fellow linode users,

I have been trying to get Jetty (Tomcat clone) to work along side Apache on port 80, so I can host a blog (pebble) on my linode with the address of “domain/blog” instead of “domain:8080/blog/”. I haven’t had any luck so far, here is my setup

Debian Linux 3.0, Apache 1.3.26, Jetty 4.2.22 and Mod_JK 3.3a-4

My understanding is the modjk Apache module should give me this functionality but with modjk enabled, Apache wont start, the following error is generated in error.log:

[emerg] (2)No such file or directory: Error while opening the workers

I have modified httpd.conf with these additions, I have tried numerous combinations as well, none work:

LoadModule jk_module /usr/lib/apache/1.3/mod_jk.so
AddModule     mod_jk.c
JkWorkersFile /etc/apache/workers.properties
Include /etc/apache/conf/mod_jk.conf

I can list the workers.properties and mod_jk.conf files, if it will help, it doesn’t seem to make any difference what I put in them but I wonder if I need to change the permissions on these files, this is how it’s setup at the moment –

-rw-r--r--    1 root     root          245 Nov 26 14:06 workers.properties
-rw-r--r--    1 root     root          110 Nov 26 05:28 mod_jk.conf

If anyone has any suggestions on how I might fix this, it would be very welcome, as after spending 2 or 3 days on this issue, I pretty much gave up, along with the idea of hosting a blog.

3 Replies

Check out the reverse-proxy functionality of Apache's mod_proxy module.

http://httpd.apache.org/docs/mod/mod_proxy.html

For example:

ProxyRequests Off

ProxyPass /blog http://127.0.0.1:8080/blog
ProxyPassReverse /blog http://127.0.0.1:8080/blog

(careful with those trailing slashes)

Reverse proxy even allows you to proxy remote sites .. so I could have linode.com/google/ bring up google.com for example :)

-Chris

Thanks Chris, I'll give that a try, it certainly sounds simpler than modjk. I would still be interested to know if anyone has had better luck with the modjk module, than me, as well.

Sorry to reply to my own thread again but I just wanted to let you know mod_proxy worked exactly as you described. I even copied and pasted your code straight into httpd.conf after enabling the module, it doesn't get any eaiser than that :D

Going back to the jetty FAQ I can see they mentioned modproxy but I didn't really take it in and tried modjk instead.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct