The Artima Developer Community
Sponsored Link

Java Buzz Forum
Tomcat 6.0.18, Apache 2.2.9, proxy_ajp on Ubuntu 8.10: Almost Trivial...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Tomcat 6.0.18, Apache 2.2.9, proxy_ajp on Ubuntu 8.10: Almost Trivial... Posted: Dec 23, 2008 7:19 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Tomcat 6.0.18, Apache 2.2.9, proxy_ajp on Ubuntu 8.10: Almost Trivial...
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

... after four hours of documentation re-reading.

[Update Tue Dec 23 15:30:20 CST 2008] The above line was written two days ago when I moved this blog away from a dying PC. Regular readers might have noticed outages of this blog for stretches of several hours at a time and during the evening hours. The whole machine would lock up while the disk light is a solid on, presumably trying to read something off the disk.

This is the second time a PC has died at home. If you remember, gao-2002 went out of commission only 23 days ago. And now gao-2006 is gone. You've seen gao-2006 mentioned here, here, here, and here.

Luckily, I was able to save all the data from the dying PC before it finally would get a kernel panic during the boot up process. I felt that I was this close to writing a different blog entry that begins: "I'm an idiot and I lost all data in this blog..."


Are your data backed up? Now would be a good time to implement your backup strategy.


With the backed up data, I was able to setup this blog on gao-2009 within four hours, most of it spent on one task. Here's entire process on this Ubuntu 8.10 machine:

  • Install sun-java6-jdk from Synaptic Package Manager
  • Install apache2 from Synaptic Package Manager
  • Install tomcat6 from Synaptic Package Manager
  • Deploy my blog at /var/lib/tomcat6/webapp/blog
  • Connecting apache2 to tomcat6

The first four steps are trivial. I did the first three prior to the move. Step 4 took minutes. Step 5 is also trivial, but I didn't know it when I started. What tripped me up is Google. Most of the search results leads to outdated information. And I spent a number of hours following the wrong leads, most of them about mod_jk, which I custom compiled in the early days of this blog.

It finally downed on me that perhaps I should read the documentations. And what a good idea what was. All I need to know is in the documentations:

The gist of the documentation can be distilled to three sentences: Apache 2.2.9 includes mod_proxy_ajp support. Tomcat 6.0.18 is configured with an AJP connector by default. All I need to do is to enable mod_proxy_ajp and then tell it where my webapp is.

To enable mod_proxy_ajp I used the command:

[root@gao-2009] # a2enmod mod_proxy_ajp

To tell Apache 2.2.9 where my webapp is I added /etc/apache2/conf.d/proxy_ajp with the following content:

ProxyPass /blog ajp://localhost:8009/blog
ProxyPassReverse /blog ajp://localhost:8009/blog

<Proxy /blog>
  Order deny,allow
  Allow from all
</Proxy>

It turns out I also need to edit /etc/apache2/mods-enabled/proxy.conf to change a line that says Deny from all into Allow from all. Without this change, noone can access the blog and I get error message that reads:

... client denied by server configuration: proxy:ajp://localhost:8009/...

That all there is to it.

Read: Tomcat 6.0.18, Apache 2.2.9, proxy_ajp on Ubuntu 8.10: Almost Trivial...

Topic: Few Days Down Previous Topic   Next Topic Topic: Wednesday Java Quiz

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use