permaculture playing cards*
The moose likes Struts and the fly likes Deploying Struts app on Linux server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Deploying Struts app on Linux server" Watch "Deploying Struts app on Linux server" New topic
Author

Deploying Struts app on Linux server

Nina Anderson
Ranch Hand

Joined: Jul 18, 2006
Posts: 148
Hi,

I'm trying to deploy my Struts application on our live Linux server and the pages are not coming up on the web and I don't know how to configure the server. I'm using Struts, Tomcat, Hibernate and jsp.

This is what I did:

I copied our *.war file in the "/var/www/html/" directory. However, when I re-start Tomcat, the contents of the war file are not made available in the web application.

Why is it that Tomcat is not automatically picking up and deploying our app after JVM restart? I tried doing the same in the "/home/webadmin/mydomain.com/html" as well with not luck.

The following are my questions:

1) Why won't my index.jsp come up? It is located in "/home/webadmin/mydomain.com/html"




2. Is my web.xml wrong?




3. What's the significance of "/var/lib/tomcat5/webapps"? Should I be using this too?

The name of our .war file is "PBWebApp.war". When I deploy to "/var/lib/tomcat5/webapps", a "PBWebApp" directory is automatically created by the system. This directory contains the jsp and java files. Here's the file structure:

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

This isn't really a Struts question, but: the webapps directory is the correct place to deploy a WAR file. How are you attempting to access the application? Are you including the webapp context in the URL?

Dave
Nina Anderson
Ranch Hand

Joined: Jul 18, 2006
Posts: 148
No...I'm NOT using the web context to access the page. I tried www.mydomain.com and www.mydomain.com/index.jsp, but neither options worked. I blank page is displayed and when I right-click to view source, I see the jsp code with my struts tag. So, it looks like the struts taglibs are not being recognized.

Also, where should I post this problem, if you don't think this is the right forum?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Originally posted by Nina Anderson:
So, it looks like the struts taglibs are not being recognized.


So If you have doubt about taglibs location , then first make sure that they are in directory \WEB-INF directory.. Usually my Netbeans IDE handles this, i.e it shows an error if he couldn't find TLDs..

Now try this highlighted changes on your index.jsp



I hoped there is proper mapping for "welcome" action


web.xml , looks fine.. Still If you are using any IDE, parse this XML for validness ..



Finally, I never deployed a webapp on Linux Server , nut basic setting is same everywhere..


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deploying Struts app on Linux server