Your article is very helpful, however i just wondering that you could help me to configure the webserver tomcat with RedHat 9 , static ip address. I followed your step 5 to 8 but it only work on localhost i couldn't access from outside to my webserver. I already have the domain name
Thank you
Main Topics
Browse All Topics





by: emalagarPosted on 2004-01-13 at 13:22:20ID: 10108098
I’m assuming you are using Windows server class OS, preferably Windows 2000 server or Windows 2003 Server. But you can run it even using Windows XP Pro or Windows 2000 Pro. If you do not use a server class OS, it just means that you have to start the server and log in and start all the web services.
site/binin dex.cgi
o.jsp (case sensitive)
domain.com "
ionsystems .com"> com</Alias >
1) Download the latest version of Apache Tomcat from Jakarta and Sun Java J2EE JDK.
a) http://jakarta.apache.org/
b) http://java.sun.com/j2ee/
2) First install Java JDK.
3) Then install Apache Tomcat. Make sure you select the option to install as a Windows Service. These will allow your web server to start automatically even if you are not logged in. Otherwise you will have to log in and start the web server manually.
After installing tomcat, test using
http://localhost:8080
You should get the index.jsp test page.
If you want to test if you can write a simple JSP page that returns Hello World, go to the Apache Tomcat directory, WebApp\ROOT\
Create a new file called: hello.jsp (Tomcat is case sensitive)
Edit the file and type:
Hello World
Save, close, and test:
http://localhost:8080/hell
4) Next, we will configure Tomcat so it will work on port 80 (the default http port) so that you don’t have to specify the port when opening a web page.
a) Make sure IIS is turned OFF because this will conflict with Apache Tomcat on port 80. To turn off IIS, go to Control Panel, Administrative Tools, Services. Look for Web Publishing service, and DISABLE it.
b) Go to Apache Tomcat directory\conf
c) Edit server.xml
d) Look for 8080 and change it to 80
e) Save, close, and test
http://localhost/
or http://localhost/hello.jsp
Port 8080 should no longer work.
NEXT, do step 5 and 6 at the same time.
5) We are assuming you are using broadband. We are also assuming that you are using static IP services. If your ISP is not giving you a static IP, it may be ok. Sometimes if you are using cable internet services, they might give you a dynamic IP, but most of the time it always reuse the same IP when it renews. If your ISP doesn't reuse the same IP address, then you might have to go to plan B.
5.1 Plan B. )
a) Go to ZoneEdit.com and open an account. They will give you 5 free DNS registrations for 1 year to start with.
b) Look for Dynamic IP Support. This will allow you to download a program that you can install into your web server. It will monitor your IP, and if it changes it will update your DNS registration. (I’ll assume you will read more about dynamic IP support from ZoneEdit).
c) Get your IP address currently provided to you by your ISP and register it.
d) Note the 2 NAMESERVER ip addresses provided by zoneedit
c) Go to step 6.2
6) Buy a internet domain name and link it to your server. I recommend GoDaddy.com or DirectNic.com. Domain names are 8 dollars and 15 dollars respectively. I like GoDaddy because their prices are the best and their services are the great. I like DirectNic because they have good integration with web, DNS, and mail services.
6.1) Using DirectNic.
a) Create an account in DirectNic, search for a good domain name, buy it. For now, just use their default DNS nameserver.
b) Then go to account management and select your domain name.
c) Purchase DirectDNS.
d) Enter your IP address into DirectDNS.
e) Wait 12 to 48 hours for it to take effect.
f) You should then be able to test www.yourdomain.com
g) Go to step 7 now.
6.2) Using GoDaddy...
a) Create an account in GoDaddy, search for a good domain name, buy it.
b) Then go to account management and select your domain name. Specify the nameserver ip addresses from step 5, plan b.
7) We are assuming that you have a router. If you do not have one, it is EXTREMELY important you get one. It provides security and connectivity services you will need for a successful web server. I recommend LinkSys or NetGear. But any will work.
a) First, if you have multiple computers, configure your web server to use NOT dynamically detect a new local ip. If you have only one computer connected to the router, then just note the IP address provided to your web server from your router (not the IP from your ISP).
b) Configure your router to use Port Forwarding service. Open port 80, and forward it to the local IP of your webserver.
8) Tomcat is using the latest http protocol that allows you to have multiple domain names for the same IP. This means your webserver can host any number of websites with their own domain name one ISP connection. But for tomcat to recognize that www.yourdomainname.com is associated with certain web pages, you need to configure tomcat accordingly.
8.1 Create local folders for each website
a) Go to Apache Tomcat\webapps\ROOT
b) Create a folder called yourdomain.com (change yourdomain to what ever your website name is)
c) Copy your web pages into this directory
8.2 Direct Apache to the right local folders for a given domain name
a) Go to Apache Tomcat\conf directory.
b) Edit server.xml
c) Look the the < HOST > element and duplicate it at the same level.
d) Set name ="yourdomain.com"
e) Set appbase="webapps/ROOT/your
f) Within < Host > element, add an alias element < alias > Specify www.yourdomain.com
This will allow you to use both www.youdomain.com and yourdomain.com when opening your website.
Example:
<Host name="emotionsystems.com" appBase="webapps/ROOT/emot
<Alias>www.emotionsystems.
<Context path="/" docBase="/">
<Context path="" docBase="">
</Host>
You can have multiple < Host > elements, one for each website.
Erwin Malagar
E-MOTION SYSTEMS CORP