|
Hi, I'm looking for a tutorial for installing Apache Tomcat on my webfaction site. Or has anyone successfully done this before and can explain it in detail? Thanks! |
|
Here's how you can install Tomcat:
You can then start Tomcat by running:
Once Tomcat is running, you should see the "If you're seeing this, you've successfully installed Tomcat. Congratulations!" page when you visit the site you created in step 2. You can stop it by running:
Note: I don't actually know much about Tomcat other than the steps above. Some things that you might need to work out further:
This answer is marked "community wiki".
Thank you very much for this tutorial. Sadly there are two issues I'm now having trouble with:
Thanks in advance for helping me again. I think both of those issues might be related to the fact that you're serving your Tomcat app with "/tomcat" as the URL path, but Tomcat itself is configured to use "/" - as a result, any URLs generated by Tomcat are pointing to the root of the domain, eg "mysite.com/" instead of "mysite.com/tomcat/". After skimming some Google search results and Tomcat docs, I think the solution is to set context paths somewhere in I've changed <host name="localhost" appbase="webapps" unpackwars="false" autodeploy="false"> to <host name="mysite.com/tomcat" appbase="webapps" unpackwars="false" autodeploy="false"> but it is still pointing to the root. Other variations did not work in total. Ok, I guess I'm not sure how to fix that. I don't think the change you made is correct, so set that back to whatever it was before you did it. I think perhaps the settings need to be made in your If you're not able to figure it out, then instead of serving your Tomcat app from domain.com/tomcat, you can instead add a subdomain to your domain and create a separate site to serve Tomcat from the root of that subdomain, thus removing any problems caused by serving it from "/tomcat". Regarding the username and password for the manager app, add the following to
Restart your Tomcat after making that change. Thanks seanf, that worked a treat. I did get a "Bad gateway" error at first, but then in the server.xml file i changed all references to port 8080 to my new port and all was peachy. Thanks for the guide Sean, works well, just one thing the wget address doesn't work. At the time of writing (Jan 17 2012) should be http://apache.mirrors.pair.com/tomcat/tomcat-7/v7.0.23/bin/apache-tomcat-7.0.23.tar.gz Thanks, updated. Hi, thanks for the guide. It's all working except than any links generated by tomcat are pointing to the root of the domain. e.g. mysite instead of mysite/tomcat/ Any suggestion? Thanks, Alfredo Hi Alfredo, This seems like the expected behavior. Can you explain in more detail what exactly you are trying to do? I've the django application using the url "mysite.com/" and the tomcat application using "mysite.com/geo" And both of them are working. But if I try to access at geoserver application installed by tomcat that I can found at the url "mysite.com/geo/geoserver" the tomcat application redirect to "mysite.com/geoserver". And that url is wrong, nothing shows up. Thanks, Alfredo That's because Tomcat doesn't know that it's actually being served from /geo, so it doesn't include that in its generated URLs. I covered this in my earlier comments on this answer - nothing's changed since then. I still don't have a solution, and my recommendation is that you serve your Tomcat app from the root of a separate subdomain, eg geo.mysite.com. I've just installed tomcat and found a minor change (for me) is needed to the above guide, line reading: echo "export JRE_HOME=/usr/lib/jvm/jre-1.6.0-openjdk" >> ~/.bashrc should be echo "export JRE_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64" >> ~/.bashrc @shoodabean - updated, thanks for the catch! Getting a Bad gateway for all of my requests. Not sure where to fix it. It seems that all my ports in server.xml are pointing to the one I created in the custom app/website Am also looking at the JRE_HOME command earlier. It appears I only have 64 bit jre, but somehow that command is only finding that my share is x86. Do I now need to install 32 bit Java? I guess I'm missing many many steps before I even get started. Fixed the 64 bit issue. Had to look in the /usr directory for what the name of my JRE was. @humanbird - you currently have a 502 error because your Tomcat server isn't running. There's a good chance that your processes were terminated because you exceeded your RAM allowance. After an hour struggle, the obvious- This should be changed- if [ "uname -i" = "x86_64" ]; then JRE_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64; else JRE_HOME=/usr/lib/jvm/jre-1.6.0-openjdk; fi to- if [ "uname -i" = "x86_64" ]; then JRE_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64; else JRE_HOME=/usr/lib/jvm/jre-openjdk; fi
showing 5 of 16
show all
|
|
I've created an one-click Tomcat installer using WebFaction's XML-RPC API. You can install it if you click here. You can find some more info about it at the installer's page, as well as an issue tracker for any installer related issues/proposals. After trying to set up myself and failing, this worked great, thanks! I have been trying this but I keep getting a message saying that there was an error in the script. Any ideas what could be wrong? I've tested the script on a couple of test users and it worked without any issue. Can you please open a support ticket so we can take a closer look at your account and its environment? |
First off, thanks so much for posting this tutorial. When I realized I was going to have to install tomcat on WebFaction myself I felt somewhat at sea, since I have no experience with that particular environment. This tutorial gave me hope, however.
Unfortunately, I haven't been able to successfully reach the "If you're seeing this, you've successfully installed Tomcat. Congratulations!" page. I defined an app in the WF admin system so that tomcat would be running on port #19461. However, when I did that, installed apache tomcat, and started it up, the following URL did not work as expected:
http://sandhillecon.webfactional.com:19461
(I've also tried adding various combinations of webapps or tomcat to the URL, but to no avail.)
I have the following set in server.xml:
I originally had host name="localhost" but made the above change after reading the documentation at http://tomcat.apache.org/tomcat-5.5-doc/config/host.html.
I believe that I have tomcat running. When I start it up I receive the following:
[sandhillecon@web195 tomcat]$ ~/webapps/tomcat/bin/startup.sh Using CATALINA_BASE: /home/sandhillecon/webapps/tomcat Using CATALINA_HOME: /home/sandhillecon/webapps/tomcat Using CATALINA_TMPDIR: /home/sandhillecon/webapps/tomcat/temp Using JRE_HOME: /usr/lib/jvm/jre-1.6.0-openjdk Using CLASSPATH: /home/sandhillecon/webapps/tomcat/bin/bootstrap.jar:/home/sandhillecon/webapps/tomcat/bin/tomcat-juli.jar
nothing that looks like an error, at least to me.
Hi,
You would never be able to access your app at http://sandhillecon.webfactional.com:19461 unless you have a dedicated IP and have got us to open that port on the dedicated IP.
Did you add your custom port to one of the sites in the panel?
If not, you will have to do that and the access the site at one of the domains used on port 80 itself since the app i served behind our frontend.
You can see the following for further help:
http://docs.webfaction.com/user-guide/websites.html#create-a-website-with-the-control-panel
Ah, okay... I knew I was being stupid. Having added a new URL path to my existing site and pointing it to my tomcat app, http://sandhillecon.webfactional.com/ntrs now shows the Apache tomcat default page.
Thank you!