This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am brand new to Linux. After my server died, my server admin brought a new one up for me. The last one was Windows. The new one is Umbutu. I'm happy to learn but, need to get back to deploying software as fast as possible - especially since this cost me a few days.
In windows, Tomcat was easy. Get a zip file, unzip it, migrate to unzipped dir (cd c:\tomcat_home\bin) and type "startup.bat" or "shutdown.bat" (assuming you've set Java_Home). Then I'd get a console where I can watch tomcat start and watch software deploy.
Now I have Linux. First thing I do is install Tomcat 7.0.29 from the command line to /usr/local/tomcat. After that, I go to the installation dir of Tomcat/bin and type ./shartup.sh. The console prints out some directories and that's it. Over time, I come to realize that Tomcat is already installed and running (Tomcat6). So, I dig around and find two more instances of Tomcat - both of them Tomcat6. One is at /usr/share/tomcat6. I browse to that dir and type ./shutdown.sh. The console starts printing and then fails with "no /conf directory found." So I find the /conf directory. It's at /var/lib/tomcat6/conf. However, there's no tomcat/bin folder in this directory and thus no startup.sh and shutdown.sh. Conf is also pointed to another directory, /etc/tomcat6. I go to etc/tomcat6 hoping I'll find a bin folder there. I don't. But I do find the tomcat-user.xml file so that's helpful. Eventually I find that the start / stop scripts are in one Tomcat6 shell script found at etc/inid.d/tomcat6... I try shutting down but can't seem to figure out the commands to make this shell do so.
I liked it better when Tomcat had one parent directory and everything was laid out in a directory structure I could see without linking all over the place. I get the sense that Linux has come pre-configured with Tomcat as a daemon which is doing me no favors. In any event, can someone tell me how to:
1. stop tomcat
2. restart tomcat with a console so I can see the log4j messages?
3. A good tutorial so that I can learn the relevant parts of Linux I need to be able to work with Tomcat?
Thanks for your help.
Joined: May 25, 2011
I finally did get Tomcat to stop. I kept trying to get it to stop by going to etc/init.d/sudo ./tomcat6 stop. The console would tell me that "sbin" is not in the environment variables. I could also still hit tomcat at my IP:8080. Finally, I tired etc/init.d/sudo ./tomcat6 start. That should have done nothing since Tomcat was already started. Instead it said, "starting Tomcat servlet engine". Odd. I hit it again from my IP:8080 and got the same page. This time when I typed etc/init.d/sudo ./tomcat6 stop, instead of telling me that sbin is not an environment var, this time it stopped Tomcat? I'm glad it did by why the error before? I hit from my IP 8080 and got no resource found.
This is some progress. Perhaps now I can get Tomcat 7 to come up. Assuming I make that happen (and get a console when I do), is there something I need to know about removing the other version of Tomcat which seems to be starting automatically with Linux?
Joined: May 25, 2011
I do now see the Tomcat7 welcome page at my ip:8080.
So, I got it started and got Tomcat6 to stop... but, I still have no console to speak of? I started Tomcat via the console but it just prints some directory info on startup. I am very accustomed to watching my log4j messages and fixing bugs when war's are deployed and trigger stack trace messages in the Tomcat console. I uploaded a war I knew would fail in order to see if I got my debug messages on in the gnome terminal window I started Tomcat 7 in. The Tomcat manager app reports the failed war deployment and I see the war in the webapps dir. But, the terminal is silent. Is there a way to get the output I'm used to on Linux?