• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat as a server & a container, how?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Head First Servlet and JSP - Bryan Basham, Kathy Sierra, Bert Bates.

Although it's a great book, it has 1 problem: It assumes I know how to install and configure Tomcat on Windows XP!!

I don't have any web server installed on my Windows XP Server. So how could I install Tomcat so that I could use the book above?

There are so many Tomcats on the web and am lost. Please help me at least search the web? Which one on the following is a prerequisite for running the examples in the book: (so I could search the web for them)

1) Tomcat stand alone
2) In-process Tomcat
3) Out-process Tomcat
4) Install Tomcat after installing J2EE
5) Install Tomcat after installing J2SE
6) Install both Apache and Tomcat

If you indicate which one is the prerequisite for the book, then I could search the web efficiently. Does Kathy or Bert have a website for help?

So far I tried 1st installing J2EE and them Tomcat but I am new to configuring Tomcat to work with Apache! Anyway, the book above only wants Tomcat as a server and a container so how can I get the right Tomcat on my windows XP Server?

I just to make use of the examples in the HF book (hands-on).

Thanks
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you download the exe version of Tomcat (Http://jakarta.apache.org/tomcat), and run it, the installer will walk you through the entire install process.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Apache/Tomcat forum.

Mark
 
firas zur
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
If you download the exe version of Tomcat (Http://jakarta.apache.org/tomcat), and run it, the installer will walk you through the entire install process.



But I keep reading in the instructions that Java should be installed 1st.
So to install Java, I install J2EE. But now there is a conflict: When you install J2EE, Apache Server is automatically installed!! But I want Tomcat to be my server (not Apache). So does this mean I have to uninstall J2EE and install something a smaller J2EE (that doesn't have apache)?

It's just I want to follow exactly what the book above says: Tomcat is enough for the purpose of the examples in the book. This is great because I am new and only want Tomcat. I don't want to keep dealing with Apache stuff.

So I need to install Eterprise Edition java because I am interested in servlet (which is am Enterprise Edition software). So how could I decrease J2EE components (by taking out Apache while keeping Java) so I could make Tomcat the Webserver? This way I could use the examples in the book above.
[ May 24, 2005: Message edited by: firas zur ]
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the following preconfigured version, very easy to install:
http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Preconfigured-Tomcat

It only installs Tomcat, not the J2EE. Where did you install J2EE from ? You just need jdk for Tomcat, so you can run JSP/Servlet. But you cannot run any EJB's, which seems ok for your practice.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I recommend against installing J2EE - it just complicates things.
Using the Apache webserver just complicates things.
All you need to get started is the J2SE - I suggest you remove J2EE and any trace of your previous Tomcat install completely and install the latest J2SE, then tomcat stand alone.
Bill
 
firas zur
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, J2EE complicates things...But I thought since Servlets is a J2EE technology, then J2EE must be installed.

I was wrong. Now I know that Servlets don�t need J2EE. I always assumed Servlets are J2EE technology by mistake, I just followed the instructions above for the pre-configured Tomcat and it just worked (when I typed localhost, a Tomcat page came up!).

But in that Tomcat page when I click on "status", a small window come up (Tomcat Manager Application) asking me for username and password! But if put "admin" as username and nothing for password, I get "HTTP Status 401 -Description: This request requires HTTP authentication ()." What could be the username and password?

How can I find the user name and password when it is all pre-configured for me web page?

Anyway, I was able to install Tomcat, thanks for the input.


[ May 24, 2005: Message edited by: firas zur ]
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be able to find that information in the tomcat-users.xml file, which is located in the $CATALINA_HOME/conf directory.

But, by default no user is setup for /manager or /status access, this is something you will have setup for yourself.

Here is an example:




This should be done while tomcat is down. When finished restart tomcat and give it a try.
 
firas zur
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I put a simple html page, (Hello.html),into the install_dir/webapps/ROOT directory, I get the following error:
"
HTTP Status 404 - /Hello.html
Description: The requested resource (/Hello.html) is not available.
"
I mean I get the above error when trying to access http://localhost/Hello.html from the browser.

I get the error after Tomcat starts successfully.

How could I avoid the error?
I tried putting Hello.html in different directories under WEBAPPS but still it coudln't be accessed from the browser (after entering http://localhost/Test/Hello.html)
[ May 25, 2005: Message edited by: firas zur ]
 
Orem Hun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the logs ($CATALINA_HOME/logs), and the error messages on your Tomcat console. It should give some clues.

If you used preconfigured one, I take you already set the variables that are set by a bat file that comes with this install. It sets the following variables:
set PATH=$JAVA-HOME\bin;%PATH%
set JAVA_HOME= J2SE install dir
set CLASSPATH=.;$CATALINA-HOME\common\lib\servlet-api.jar;$CATALINA-HOME\common\lib\jsp-api.jar;..;..\..;%CLASSPATH%
 
firas zur
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I re-installed the newest one (not the pre-configured one) and it now works.

So my suggestion to everyone is:
1) Installed the pre-configured one
2) Remomove it while keeping the configuration files for later comparison with later installation
3) Install the newest Tomcat using windows installer (.exe file)
4) Compare the files you saved in 2 with the newest Tomcat one
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by firas zur:
Yes, J2EE complicates things...But I thought since Servlets is a J2EE technology, then J2EE must be installed.

I was wrong. Now I know that Servlets don�t need J2EE. I always assumed Servlets are J2EE technology by mistake, I just followed the instructions above for the pre-configured Tomcat and it just worked (when I typed localhost, a Tomcat page came up!).



You were not wrong. Servlets are a part of J2EE.
Tomcat ships with the J2EE components that it needs.
That's why you don't need to install it yourself.
reply
    Bookmark Topic Watch Topic
  • New Topic