• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Internet requests to Tomcat

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Saloon Keeper
Posts: 28067
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
David Perry
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>>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.
 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try grep -n ServerName /etc/httpd/conf/httpd.conf and see what host name
you have assigned to ServerName.
 
Tim Holloway
Saloon Keeper
Posts: 28067
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
rtfm

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

kind regards
 
slava zy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
catch it before it slithers away! Oh wait, it's a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic