LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   access webpage on another PC in my network (https://www.linuxquestions.org/questions/linux-software-2/access-webpage-on-another-pc-in-my-network-4175445079/)

timl 01-10-2013 10:46 PM

access webpage on another PC in my network
 
Hi, I have run into a brick wall and I think I may be missing something obvious.

I set up LAMP/Mediawiki 1.20.2 on a CENTOS 6 server. From that server I can http://10.1.1.101/mw. With mw being the name of my wiki. At this point I am editting the wiki. I can also see 10.1.1.101/index.php so it looks like all components are working internally.

I want to view the wiki from firefox on another PC. (which can access 10.1.1.101) so I try 10.1.1.101/mw and I get
Firefox can't establish a connection to the server at 10.1.1.101.
Is there something I need to open on the CENTOS firewall to allow incoming http traffic?

Thanks

bathory 01-11-2013 12:33 AM

Hi,

I guess you need to open port 80. To do so, add
Code:

-A RH-Firewall-1-INPUT -m tcp -p tcp --dport 80 -j ACCEPT
before the COMMIT line in /etc/sysconfig/iptables and restart the iptables service.
For more detail have a look here

Regards

timl 01-12-2013 12:29 AM

Hi bathory, firstly thanks for the link and advice. I have added both to my wiki.

I entered the new line (which I verified in the link provided) to iptables and restarted the service. When I restarted I got an error:

iptables: Applying firewall rules: iptables-restore: line 22 failed
[FAILED]
I found a site (http://www.mythdora.com/?q=node/4638) which recommended removing the RH-Firewall-a component of the line. This allowed iptables to restart but I still could not access HTTP from another PC. Is this advice valid?

Anyway, I have run our of time today and will resume tomorrow with a better idea of what I am doing.


Cheers

bathory 01-12-2013 03:41 AM

Quote:

I entered the new line (which I verified in the link provided) to iptables and restarted the service. When I restarted I got an error:


iptables: Applying firewall rules: iptables-restore: line 22 failed
[FAILED]
Did you put your rule(s) before the COMMIT line?

Quote:

I found a site (http://www.mythdora.com/?q=node/4638) which recommended removing the RH-Firewall-a component of the line. This allowed iptables to restart but I still could not access HTTP from another PC. Is this advice valid?
Don't think so. Maybe you need to add
Code:

:RH-Firewall-1-INPUT - [0:0]
just after the
Quote:

:OUTPUT ACCEPT [0:0]
line.

timl 01-13-2013 02:19 PM

Hi bathory, Firstly I could not get iptables to accept the RH-Firewall-1-INPUT component. I kept getting the error mentioned above. I ended up with this line.
-A INPUT -m tcp -p tcp --dport 80 -j ACCEPT
I also tried with the --state parameter. I restarted ip tables without error but I could still not access the site.

Hmmmm, embarrassed mode! I restarted firefox and I can access the site.

Thanks for your help and the link. I am marking this as solved


All times are GMT -5. The time now is 08:40 PM.