Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a server with Centos 6 on it and I have installed XAMPP on it. I have this server on static IP address.

But I can't access this server's IP address from other PCs. I tried to access XAMPP on another PC with a static IP address with Windows OS, and it works perfectly. Even accessing it from the server itself and it's open.

But I can't access the server IP from any other PC. I can ping the server. I can access SSH using Putty on the server and login. But I can't open the localhost of the server from any other computer on the network.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Maybe it could be your firewall. The default firewall of CentOS permits ssh input(tcp 22) and icmp(ping)

[root@ ~]# cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

Try at first stopping your firewall issuing the following command:

[root@ ~]# /etc/init.d/iptables stop

Now, test if you can access your XAMPP server


After that, it could be a good catch to enable just the ports you need to access(80 or 443, or both):

80(www)

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

443(https)

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

both:

iptables -A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 80,443 -j ACCEPT
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.