LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   apache2 running but can't visit anywhere (https://www.linuxquestions.org/questions/linux-server-73/apache2-running-but-cant-visit-anywhere-606543/)

JackyRang 12-13-2007 09:35 AM

apache2 running but can't visit anywhere
 

I am try to run two web applications on a Linux Server,one is jsp,another is php.

So I installed tomcat5(use:80) and apache2(:use 8081) on the linux, without doing any things to combine them.
(I just want to them do their own job)

Now,the problem is : tomcat works well,but I can't even vist apache default page by browser,although apache start OK ,no error report,the 8081 port is listening(use netstat -an |grep 8081),the process of httpd is running.
Quote:

tcp 0 0 :::8081 :::* LISTEN 9196/httpd
Can any body tell me the potential reasons?

ps:I install apache on another linux mathine ,same tar.gz ,same change to /apache/conf/httpd.cnf .
And it works well.

I am a Newbie for linux httpd,so ,any advise is helpful .Thanks anyway.

JackyRang 12-13-2007 09:43 AM

this is my service iptables status

Quote:

琛ㄦ牸锛歠ilter
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255
ACCEPT esp -- 0.0.0.0/0 0.0.0.0/0
ACCEPT ah -- 0.0.0.0/0 0.0.0.0/0
ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTAB LISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:2 2
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:8 0
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:2 1
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:2 5
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-ho st-prohibited


farslayer 12-13-2007 09:44 AM

Appears to be a rule to accept traffic on port 80.. so I would think you need a rule to accept traffic on port 8081


ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80

ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:8081

JackyRang 12-13-2007 09:56 AM

sorry did u show the commond ?
i tried this
Quote:

[root@localhost ~]# ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:8081
-bash: ACCEPT: command not found
ps:sorry it's 24:00 in china I have to go .Good noon ,everyone.

farslayer 12-13-2007 10:48 AM

I'm no expert but I think it would be something like...

iptables -I RH-Firewall-1-INPUT 10 -p TCP -s 0/0 --destination-port 8081 -j ACCEPT


I'm sure someone will correct me if this is wrong... (please do)

JackyRang 12-13-2007 08:09 PM

thanks very much!! Farslayer ,it works.


All times are GMT -5. The time now is 05:17 AM.