This week's book giveaway is in the JavaScript forum.
We're giving away four copies of JavaScript Promises Essentials and have Rami Sarieddine on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Internet requests to Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Internet requests to Tomcat" Watch "Internet requests to Tomcat" New topic
Author

Internet requests to Tomcat

David Perry
Greenhorn

Joined: Dec 12, 2003
Posts: 19
I know this sounds like an Apache/Tomcat question, however, the solution may be related to the Linux configuration, so I would like to post it here to get any feedback (I have also posted this question on the Apache/Tomcat forum. I hope this is not a no-no, but I checked the FAQ and didn't see anything regarding posting the same question on two separate boards):

I have single server running Red Hat 9 with j2sdk1.4.2_04, httpd-2.0.49 and jakarta-tomcat-4.1.30. Java is working (I compiled a test servlet with no errors); Apache is working (I set up a default web page and I can view it through the browser on the server by typing http://localhost); Tomcat is working (I can view my test servlet through the browser on the server by typing http://localhost:8080/mytest/hello).

I have a domain name registered (mysite.com) and have configured the IP address to point to my Red Hat server. I have had friends test access to the server through the internet by typing www.mysite.com, and they are able to see my default web page. So far so good. What I'm attempting to do now is set up the Tomcat content so that it also can be accessed through the internet (ie. www.mysite.com:8080/mytest/hello). This is where I'm stuck. I don't know how to configure the server to allow internet access to the Tomcat content.

When I set up the server, I entered the hostname as darktower and configured the IP information. I did not configure anything regarding my domain (mysite.com). The following is what my /etc/host file contains:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 darktower localhost.localdomain localhost

When I start Apache, I get the following message:

httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Can someone please tell me what I have to configure to serve remote requests from the internet to Tomcat? (ie. www.mysite.com:8080/mytest/hello)

Thanking you in advance for any help and feedback. David Perry.
[ June 16, 2004: Message edited by: David Perry ]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

T'm not entirely sure what that means, but the way it works is that DNS resolves ONLY IP addresses, not port numbers, so if the domain name www.mysite.com works for Apache, Tomcat can also work.

However, Red Hat sets up a firewall using iptables (or formerly ipchains). You need to make sure that port 8080 tcp/ip is accessible through the firewall.


Customer surveys are for companies who didn't pay proper attention to begin with.
David Perry
Greenhorn

Joined: Dec 12, 2003
Posts: 19
>>However, Red Hat sets up a firewall using iptables (or formerly ipchains). You need to make sure that port 8080 tcp/ip is accessible through the firewall.

Okay, that makes sense. Can you tell me what file acts as the firewall to grant/deny access through the ports?

Thanks for your feedback. David.
himanshu patel
Ranch Hand

Joined: Feb 03, 2003
Posts: 205
try grep -n ServerName /etc/httpd/conf/httpd.conf and see what host name
you have assigned to ServerName.


If you want to become a rich, do not work for others but make others to work for you.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

Originally posted by David Perry:
>>However, Red Hat sets up a firewall using iptables (or formerly ipchains). You need to make sure that port 8080 tcp/ip is accessible through the firewall.

Okay, that makes sense. Can you tell me what file acts as the firewall to grant/deny access through the ports?

Thanks for your feedback. David.


/etc/sysconfig/iptables for iptables. You may prefer to use the /sbin/iptables command to add/change rules (use iptables -L to list what's in effect). Once you have rules you like, do "/sbin/service iptables save" to make them survice boots. You can also edit the iptables file directly, but it's better not to.

Redhat provides a firewall configuration tool for simple firewall setup. I can't remember its name, but it's the one that the Red Hat setup program invokes. You'll find its name listed in the /etc/sysconfig/iptables file.

Incidentally, Red Hat created the /etc/sysconfig file to hold config info that's built and maintained by the GUI/curses config programs, especially info that would otherwise require program changes to init scripts. I spent years blundering around in there before realizing that it's actually preferable to use the utilities.
slava zy
Greenhorn

Joined: Jul 05, 2004
Posts: 4
rtfm

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/index.html

kind regards


save the earth, kill a spammer
slava zy
Greenhorn

Joined: Jul 05, 2004
Posts: 4
another alternative available for tomcat + Apache is to use mod_webapp (i use it)

attention, you'll probably need to compile yourself your mod_webapp
so make sure apache and apache-devel rpm packages are installed on your linux system.


google on mod_webapp howto


cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Internet requests to Tomcat