This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have a web application working in Tomcat 6 under Windows. I need to run it in Ubuntu Server.
I installed Tomcat on Ubuntu and http://192.168.1.9/index.html I get the base "It Works" screen from Tomcat. 192.168.1.9 is the IP of the Ubuntu server.
I created a WAR file of my application (I will call myapp) off of windows. I tested it on the Windows, placing the war file in the webapps directory and it auto deployed correctly.
In Ubuntu, I placed the war file in the webapps directory (/usr/share/tomcat6/webapps), this file was moved through a samba share, not FTP.
I restarted tomcat and it does not deploy, and yes, autoDeploy is set to true in the server.xml file.
I then tried to copy in all the files manually. This is everything under the webapps directory for "myapp" (this is the jsp's, servlets class files, etc.). Again, after restarting tomcat, the application is still not running.
http://192.168.1.9/manager/list gives:
OK - Listed applications for virtual host localhost
/manager:running:0:/usr/share/tomcat6-admin/manager
/:running:0:ROOT
/host-manager:running:0:/usr/share/tomcat6-admin/host-manager
What am I missing?
Thanks in advance for any help,
Don
(Ubuntu 10.04, Windows 2000, Tomcat 6, MySql 5.1,
Ubuntu java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.2) (6b20-1.9.2-0ubuntu1~10.04.1)
Windows java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02),
connects to the same remote MySql database)
Have you checked the log files? What does your web.xml file look like? Do you have any paths in your xml files that refer to your Windows box? Is your MySql database configured to allow access from your Ubuntu box?
First try with your 8080 port (or whatever your Tomcat is listening on), since the "It works" message seems to come from your Apache web server (not tomcat !).
You seem to have some proxy configured in Apache, but most likely not the way you want it.
don cline
Ranch Hand
Joined: Oct 10, 2003
Posts: 35
posted
0
Tom,
Thank you for your post.
Briefly, I am pretty sure that I what I am doing wrong is very basic. I have copied the log files and as you will see, Tomcat did not try to even deploy the app.
Have you checked the log files?
The log files follow:
catalina.out
Jan 2, 2011 8:05:56 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /
usr/lib/jvm/java-6-openjdk/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/../lib/i386:/usr/java/packages
/lib/i386:/usr/lib/jni:/lib:/usr/lib
Jan 2, 2011 8:05:57 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Jan 2, 2011 8:05:57 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 4331 ms
Jan 2, 2011 8:05:58 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 2, 2011 8:05:58 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Jan 2, 2011 8:05:58 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
Jan 2, 2011 8:05:59 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
Jan 2, 2011 8:06:00 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Jan 2, 2011 8:06:00 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-80
Jan 2, 2011 8:06:00 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3215 ms
catalina.2011-01-02.log
Jan 2, 2011 8:05:56 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /
usr/lib/jvm/java-6-openjdk/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/../lib/i386:/usr/java/packages
/lib/i386:/usr/lib/jni:/lib:/usr/lib
Jan 2, 2011 8:05:57 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Jan 2, 2011 8:05:57 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 4331 ms
Jan 2, 2011 8:05:58 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 2, 2011 8:05:58 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Jan 2, 2011 8:05:58 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
Jan 2, 2011 8:05:59 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
Jan 2, 2011 8:06:00 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Jan 2, 2011 8:06:00 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-80
Jan 2, 2011 8:06:00 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3215 ms
localhost.2011-01-02.log
this was empty
What does your web.xml file look like?
The contents follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<description>
Servlet and JSP Examples.
</description>
<display-name>NeuralNetII</display-name>
<!-- Define servlets that are included in the NeuralNetII application -->
Do you have any paths in your xml files that refer to your Windows box?
I am pretty confident that I do not. There is one jsp dialog that is not yet OS neutral, but all of the rest should be. I would simply expect this jsp to fail in its function.
Is your MySql database configured to allow access from your Ubuntu box?
The Ubuntu box is already accessing the MySql database. Much of this application runs as a stand alone Java app or under tomcat. The standalone part is running on that Ubuntu box (192.168.1.9) and accessing the database. BTW, MySql is running on another Ubuntu server box (192.168.1.7).
Thank you for you suggestion. But, the log files were not a big help to me. Again, the war file is placed in /usr/share/tomcat6/webapps and tomcat seems to not even try to deploy it.
Don
Costi Ciudatu
Ranch Hand
Joined: Oct 24, 2006
Posts: 74
posted
0
On ubunbu, it seems like the webapps directory is under: /var/lib/tomcat6/webapps.
Actually, /var/lib/tomcat6 is set as CATALINA_HOME by the init script.
Is that /usr/share/tomcat6/webapps created by you (no such directory is created when the package is installed) ?
don cline
Ranch Hand
Joined: Oct 10, 2003
Posts: 35
posted
0
Costi,
Thank you for your post.
I do not have Apache installed. I am running Tomcat as a standalone application. I have changed the port it listens to, to port 80 in /etc/tomcat6/server.xml
Of course, I had to change /etc/default/tomcat6 to allow it to turn on AUTHBIND.