how can i install tomcat?
hi
when i install tomcat ,it seems every thing is ok.but when i tried: jakarta-tomcat-5.5.9/bin/startup.sh it gives me this error: The BASEDIR environment variable is not defined correctly This environment variable is needed to run this program how can i solve this problem?plz help me |
you need to set the CATALINA_HOME and JAVA_HOME environment variables as well as update your CLASSPATH environment variable.
You can do this in /etc/profile. If you put it in here, you'll then need to 'source /etc/profile' before you start up tomcat. Mine: Code:
# /etc/profile |
hi
thx for reply.i export my CATALINA_HOME and JAVA HOME and it runs well.but after some minutes when i tried again it doesn't work.and now some times it workes and some times it doesn't.do u know what happen? |
well, if you've export your variables as commands in a shell term (like konsole), those variables are only valid during that shell's session. this means when you exit the shell, the environment variables are lost. If you've set the variables in /etc/profile, the most reliable way to make sure the variables are set everytime you login in or use the shell term would be to reboot the machine, but logging in and out of your session should work, although, I've had logging in and out not work for me before.
My guess is that it doesn't work the next time because you've export those environment variables in a shell term, close the shell term, and then try to start it up again in a new shell term. But I don't really know, as I'm not using version 5.X of tomcat; I'm using 4.1.31. It could be something like version 5.X is buggy... I couldn't really tell you. Another thing, update your CLASSPATH environment variable also. |
thx a lot.u help me so much.but i'm new in linux and cann't understand how can i do this?can u explain more?
|
Well let me ask you, how do you boot up into linux? Do you boot straight into graphical mode (init 5)?
Let's pretend you do. Here's the scenario. You log into your user account. You open up a shell terminal. You su into root so you can start tomcat. You need to set the environment variables, so you do. You start up tomcat. You exit out of root. Now you want to restart tomcat, so you su back into root. Now here is where you'd have problems. Those environment variables you set in your previous session are no longer set. You need to make those environment variables permanent. So look at the example /etc/profile I posted and copy the lines you need in regards to classpath, catalina_home, and java_home. For the classpath, you'd probably only need: CLASSPATH=/usr/local/tomcat/bin:/usr/java/j2sdk1.4.2_10/lib After editing your /etc/profile, log out of your user session and log back in. Your environment variables should be set for you and when you su as root in the shell term. You can see by typing in the command: echo $CLASSPATH echo $JAVA_HOME echo $CATALINA_HOME if the outputs come up blank, and you're sure you've set up your /etc/profile correctly, then just reboot the machine. Else, you should be golden. |
thx dear megaspaz.u solve my problem.thx a lot
|
All times are GMT -5. The time now is 08:37 AM. |