Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving web app directory

Status
Not open for further replies.

maxpower1

Programmer
Jul 29, 2001
488
US
I moved the web app directory to be on a different drive; E drive. Hence, I had to change the port number to 8081 to avoid conflicts with 8080.

The tomcat and its program is still located on the C drive.
When I manually double click the startup.bat file on the C driver, the Tomcat starts up nicely and managed to find server.xml file that is located on the E drive. Hence, everything swell.

However, when I start up Tomcat using NT service, it takes the default: port 8080 and ran the server.xml that is located on the C drive. I understand the batch file
run "bootstrap" start command.

Question: What do I need to modify that when Tomcat starts up as an NT service, it uses the server.xml on the E drive.

thank you

~za~
You can't bring back a dead thread!
 
What does moving the "web app directory" have to do with the Tomcat server home directory? Why does moving the web app directory mean you need the HTTP Server on a different port?

-pete
 
>What does moving the "web app directory" have to do with >the Tomcat server home directory?
i may not understand your question directly but i have tomcat running on nt cluster. hence, for easy maintenance, we decided to move the webapps directory to the cluster drive. Hence, if the machines fails, it will use that same webapp directory. Moving wepaps directory means you have to move server.xml to this new directory as well.

>Why does moving the web app directory mean you need the >HTTP Server on a different port?
I did this so that my Tomcat instance doesn't try to open the same host and ports as someone else's Tomcat instance on the same server computer, and so that it doesn't try to load apps, i.e. example app that comes with tomcat.

I did some testings and found out that:-
1. if i started tomcat using startup.bat, it works fine. I t found the server.xml that is located on the E drive.
however,
2. when i try to run it using nt service, it runs:-
java... "bootstrap.jar" start command. This is the one that causes the problem; since it cannot find the server.xml that is located on the e drive even though
i specifically set the environment variable CATALINA_BASE to point to this E drive.

thanks pete.



~za~
You can't bring back a dead thread!
 
>> Moving wepaps directory means you have to move
>> server.xml to this new directory as well.

See that is the part i don't undestand. The Tomcat directory structure looks like this:

+ TOMCAT
----> + conf
----------------> server.xml
----> + webapps

So when you move the webapps folder, server.xml stays right where it is.



-pete
 
oh. i see.

when you customize(under control panel in windows)
CATALINA_HOME = C:\Tomcat 4.1\;
CATALINA_BASE = E:\Tomcat-Instance\webapps;

then you can change the port number(because of reason above) to 8081, and move your app, i.e sample to be
located under:-

E:\Tomcat-Instance\webapps\sample

Then, move the \conf(including server.xml) and all other tomcat directories like log etc, to be under \webapps on this E drive as well. This is working fine now as long as I start Tomcat through startup.bat located under
C:\Tomcat41\bin directory. How does it know where to go? Because I set CATALINA_BASE to point to E drive.

BUT, when I start Tomcat through NT service(an option given when you install Tomcat), it runs this command instead:-

C:\j2sdk1.4.2\bin\java.exe -jar -Duser.dir="C:\Tomcat41" "C:\Tomcat41\bin\bootstrap.jar" start

Somehow, it uses CATALINA_HOME instead of CATALINA_BASE to locate server.xml. (This is my problem). I want it automatically locate the server.xml on the E drive instead.

hope i get the msg across.

thx again.




















~za~
You can't bring back a dead thread!
 
I think I'm getting close. the -Duser.dir has to point to the webapps directory on the E drive. I am getting closer now. I'll let you know when it works. groovy!

~za~
You can't bring back a dead thread!
 
ok. i got the solution. in windows, bring up regedt32.exe

HKEY_LOCAL_MACHINE\SYSTEM\CONTROLSET001\SERVICES

and find tomcat 4.1. Under parameter:-

Dcatalina.home
change the directory to the new webapp directory.

I know it's like "poking" things which I don't like but so far, this is the fix until Tomcat 5 comes out.

~za~
You can't bring back a dead thread!
 
>> I know it's like "poking" things

Perfectly fine solution. But i still don't understand why you didn't just move the whole Tomcat installation and change the CATALINA_HOME value?

-pete
 
It's running on windows 2000 cluster, remember ;)
Hence, you need to have tomcat installed on both
servers (on the c drive) (primary and backup).

E drive is the logical drive(shared drive). Hence, if the primary server fails, the secondary server will be able to get to the same shared drive.

I just try to reduce maintenance works in the future. I mean, I could have both web apps on two separate drives but then I have to maintain 2 repositories - which would be bad.
What if some happy smurf shows up and update the jsp page on one machine and not the other. let's not get there...

~za~
You can't bring back a dead thread!
 
>> It's running on windows 2000 cluster, remember ;)

[hammer] DOH! To many Tek-Tips threads for me today i guess. Thanks for not telling me to sod off ;-)

-pete
 
well, you help me to think better. thanks

~za~
You can't bring back a dead thread!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top