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!

Beginner to Tomcat.Where to begin? 1

Status
Not open for further replies.

caxman

Technical User
Feb 16, 2004
2
IE
Can anyone help me out with starting up Tomcat as a beginner? I have Apache Tomcat installed on my machine but from there I'm pretty lost. I've tried reading help files but to no avail. Can anyone help?
 
A couple question s for you would be:

Are you on a Windows machine or a Unix/Linux machine?
What are you using tomcat for?
- servlets/JSPs
- just goofing around
- static html ...
Are you familiar with any other servlet containers or web servers?

The best place to get started is to define your environment variables:
- JAVA_HOME (the directory in which your JAVA JDK is installed)
- CATALINA_HOME (the directory in which tomcat is installed)

Then you can run <CATALINA_HOME>\bin\startup.bat (assuming a windows install) or <CATALINA_HOME>/bin/startup.sh (assuming a Unix/Linux install)

Tomcat has an &quot;examples&quot; web application that you can test and goof around with. After you start Tomcat, it is accessible at &quot;
If you're going to build your own Java web application, you will be well off purchasing a good book on the topic. Two that I recommend are:
- Professional Apache Tomcat (Wrox Press)
- Tomcat the Definitive Guide (O'Reilly)
 
I am using a Windows XP machine .I plan to use it for
- servlets/JSPs
- static html ...
I am not familiar with any other servlet containers or web servers.

I got tomcat up and running but now what? I create the documents where and save them where as to be able to view them in a browser?
 
OK, so you installed tomcat in c:\xxxxxxx - all the tomcat files are tucked away in here.

look in the \conf\server.xml for the info on your config.

you view the pages in your browser at &quot; (i.e. your machine, port 8080 - the default for a tomcat install. the port number can change.)

under \conf\, you'll find \Catalina\localhost\ with a bunch of .xml files.

Each one of these relates to a seperate context. This has special meaning to jsp. Each of these contexts references a different virtual subdirectory on the server: e.g. etc.

The ROOT context is the page you see at
other contexts have their own subdirectory. Follow?!

You create the documents wherever you want, save them where you want - then use the conf//.xml files to tell Tomcat where you've put the files.

I'd suggest an O'Reilly book that did me a lot of favours in the beginning: JavaServer Pages, Hans Bergsten [o'Reilly, 2001] ISBN 1-56592-746-x

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
If you want to use Tomcat for Unix to create servlets/jsp and for static html, where do you download Tomcat? Is it free? How does this relate to the Java SDK 1.4.

I am used to an NT environment and have installed the SDK 1.4 on my personal machine.

I know nothing of Tomcat. Can someone compare the differences. Also, servlets are sort of new to me although I am creating classes, etc. in Java.

Thanks for your help.

scripter73


Change Your Thinking, Change Your Life.
 
scripter73: hope this helps address your questions
[ul]
[li]the tomcat project is on (part of the Apache project). The Documentation and FAQ sections there are also useful.[/li]
[li]It's free[/li]
[li]The SDK is completely seperate from Tomcat, but Tomcat needs the SDK to run. The SDK allows you to run/compile Java apps on your machine, whilst Tomcat uses the SDK to compile pages (.jsp) and servlets within the context of a web server.[/li]
[li]Sun describe a servlet as 'A servlet can almost be thought of as an applet that runs on the server side'. It's basically a way of seperating the presentation from the business logic. (think: MVC - Model - View - Controller).[/li][/ul]

Another 'intro' site is on
<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Thanks so much for your response. I appreciate it.



Change Your Thinking, Change Your Life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top