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 testservlet 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
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.