{"id":35,"date":"2008-10-08T16:25:00","date_gmt":"2008-10-08T20:25:00","guid":{"rendered":"http:\/\/clusterbleep.net\/blog\/2008\/10\/tomcat5-5-and-apache2-on-ubuntu-8-04-hardy-heron\/"},"modified":"2008-10-08T16:25:00","modified_gmt":"2008-10-08T20:25:00","slug":"tomcat5-5-and-apache2-on-ubuntu-8-04-hardy-heron","status":"publish","type":"post","link":"http:\/\/clusterbleep.net\/blog\/2008\/10\/08\/tomcat5-5-and-apache2-on-ubuntu-8-04-hardy-heron\/","title":{"rendered":"Tomcat5.5 and Apache2 on Ubuntu 8.04 Hardy Heron"},"content":{"rendered":"<p>Getting Tomcat and Apache working together isn\u00e2\u20ac\u2122t very complicated as long as you know what to do!<\/p>\n<h4>Installation<\/h4>\n<ol>\n<li>Enable multiverse repository<\/li>\n<li><code>sudo apt-get install sun-java6-jdk apache2<\/code><\/li>\n<li><code>sudo apt-get install tomcat5.5 tomcat5.5-admin tomcat5.5-webapps libapache2-mod-jk<\/code><\/li>\n<li><code>sudo \/etc\/init.d\/apache2 restart<\/code><\/li>\n<li><code>sudo \/etc\/init.d\/tomcat5.5 restart<\/code><\/li>\n<\/ol>\n<p><strong>Tests:<\/strong><\/p>\n<ul>\n<li>Apache2: <a href=\"http:\/\/localhost\/\">http:\/\/localhost<\/a><\/li>\n<li>Tomcat: <a href=\"http:\/\/localhost:8180\/\">http:\/\/localhost:8180<\/a><\/li>\n<\/ul>\n<p><em>If you get an access error from the Tomcat test, it can usually be fixed by re-installing the sun java6 jdk, performing the Tomcat config below, and then restarting Tomcat: sudo apt-get install \u00e2\u20ac\u201creinstall sun-java6-jdk<\/em><\/p>\n<h4>Configure Tomcat<\/h4>\n<p><code>sudo nano -w \/etc\/tomcat5.5\/tomcat-users.xml<\/code><\/p>\n<blockquote><p>&lt;tomcat-users&gt;<br \/>&lt;role rolename=&#8221;admin&#8221; \/&gt;<br \/>&lt;role rolename=&#8221;manager&#8221; \/&gt;<br \/>&lt;role rolename=&#8221;tomcat&#8221; \/&gt;<br \/>&lt;user username=&#8221;tomcat&#8221; password=&#8221;tomcat&#8221; roles=&#8221;tomcat&#8221; \/&gt;<br \/>&lt;user username=&#8221;root&#8221; password=&#8221;password&#8221; roles=&#8221;admin,manager,tomcat&#8221; \/&gt;<br \/>&lt;\/tomcat-users&gt;<\/p><\/blockquote>\n<p><code>sudo \/etc\/init.d\/tomcat5.5 restart<\/code><\/p>\n<h4>Configure Apache to Tomcat Bypass<\/h4>\n<p><code>sudo cp \/etc\/libapache2-mod-jk\/workers.properties \/etc\/apache2\/<\/code><br \/><code>sudo nano -w \/etc\/apache2\/workers.properties<\/code><\/p>\n<blockquote><p>#workers.tomcat_home=\/usr\/share\/tomcat5<br \/>workers.tomcat_home=\/usr\/share\/tomcat5.5<\/p>\n<p>#workers.java_home=\/usr\/lib\/jvm\/java-gcj<br \/>workers.java_home=\/usr\/lib\/jvm\/java-6-sun<\/p><\/blockquote>\n<p><code>sudo nano -w \/etc\/apache2\/mods-available\/jk.conf<\/code><\/p>\n<blockquote>\n<pre># Where to find workers.properties<br \/># Update this path to match your conf directory location (put workers.properties next to httpd.conf)<br \/>JkWorkersFile \/etc\/apache2\/workers.properties<br \/><br \/># Where to put jk shared memory<br \/># Update this path to match your local state directory or logs directory<br \/>JkShmFile     \/var\/log\/apache2\/mod_jk.shm<br \/><br \/># Where to put jk logs<br \/># Update this path to match your logs directory location (put mod_jk.log next to access_log)<br \/>JkLogFile     \/var\/log\/apache2\/mod_jk.log<br \/><br \/># Set the jk log level [debug\/error\/info]<br \/>JkLogLevel    info<br \/><br \/># Select the timestamp log format<br \/>JkLogStampFormat \"[%a %b %d %H:%M:%S %Y] \"<br \/><br \/># Send everything for context \/examples to worker named worker1 (ajp13)<br \/>JkMount  \/admin\/* ajp13_worker<br \/>JkMount  \/manager\/* ajp13_worker<\/pre>\n<\/blockquote>\n<p><code>sudo ln -s \/etc\/apache2\/mods-available\/jk.conf \/etc\/apache2\/mods-enabled\/jk.conf<\/code><br \/><code>sudo \/etc\/init.d\/apache2 restart<\/code><\/p>\n<h4>Final Tests:<\/h4>\n<ul>\n<li>Tomcat Admin: <a href=\"http:\/\/localhost\/admin\/\">http:\/\/localhost\/admin\/<\/a><\/li>\n<li>Tomcat Manager: <a href=\"http:\/\/localhost\/manager\/html\">http:\/\/localhost\/manager\/html<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Getting Tomcat and Apache working together isn\u00e2\u20ac\u2122t very complicated as long as you know what to do! Installation Enable multiverse repository sudo apt-get install sun-java6-jdk apache2 sudo apt-get install tomcat5.5 tomcat5.5-admin tomcat5.5-webapps libapache2-mod-jk sudo \/etc\/init.d\/apache2 restart sudo \/etc\/init.d\/tomcat5.5 restart Tests: &hellip; <a href=\"http:\/\/clusterbleep.net\/blog\/2008\/10\/08\/tomcat5-5-and-apache2-on-ubuntu-8-04-hardy-heron\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,6,5,7],"tags":[],"class_list":["post-35","post","type-post","status-publish","format-standard","hentry","category-java","category-linux","category-planet-ubuntu-users","category-tech"],"_links":{"self":[{"href":"http:\/\/clusterbleep.net\/blog\/wp-json\/wp\/v2\/posts\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/clusterbleep.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/clusterbleep.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/clusterbleep.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/clusterbleep.net\/blog\/wp-json\/wp\/v2\/comments?post=35"}],"version-history":[{"count":0,"href":"http:\/\/clusterbleep.net\/blog\/wp-json\/wp\/v2\/posts\/35\/revisions"}],"wp:attachment":[{"href":"http:\/\/clusterbleep.net\/blog\/wp-json\/wp\/v2\/media?parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/clusterbleep.net\/blog\/wp-json\/wp\/v2\/categories?post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/clusterbleep.net\/blog\/wp-json\/wp\/v2\/tags?post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}