LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-23-2013, 12:40 PM   #1
somen.chanda
LQ Newbie
 
Registered: Sep 2007
Location: Kolkata, INDIA
Distribution: RHL7.3/8.0, RHEL V3
Posts: 5

Rep: Reputation: 0
Exclamation Problem in finding the http server through LAN


Dear friends, I'm using Scientific Linux 5.2 (2.6.18-348.4.1.el5) and successfully installed Apache2.0 and PHP, started httpd. Therefore, I'm able to see the default Apache page through the browser (http://127.0.0.1/ Or http://192.168.1.2/) when looked from the localhost. I tested the setup by putting my html home page at /var/www/html/ successfully from localhost. I've a small LAN at my home which connects two windows laptops and the linux desktop with the DSL router modem (192.168.1.1). Whenever I try to look for http://192.168.1.2/ from the windows laptops it fails to connect. The router always searches for the requested ip in the outer world through the DNS. So,I edited the httpd.conf for the Listen, Allow and Deny parameters, restarted httpd but no result. Can anyone guide me what to do in this situation? I don't have a private domain setup.

Regards.
Somen.
 
Old 07-23-2013, 01:18 PM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Quote:
Originally Posted by somen.chanda View Post
The router always searches for the requested ip in the outer world through the DNS.
This is wrong. No router should search "outer world" for a private ip.
If I understand you correctly, your DSL-modem has 2 connected interfaces, one for internet the other with ip 192.168.1.1.
And your computers are all in 192.168.1.0/24.
How do you know your modem searches outer world? If it does, with this setup it shouldn't and might be faulty - unless you manually entered a static route in the DSL-modem?
If thta was just a guess, I suggest you check the firewall on your Scientific Linux.
 
Old 07-23-2013, 01:25 PM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
service iptables stop
 
1 members found this post helpful.
Old 07-24-2013, 10:06 AM   #4
somen.chanda
LQ Newbie
 
Registered: Sep 2007
Location: Kolkata, INDIA
Distribution: RHL7.3/8.0, RHEL V3
Posts: 5

Original Poster
Rep: Reputation: 0
Many thanx to pingu and szboardstretcher. "/sbin/service iptables stop" did the following -
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]

and now I'm able to browse my html homepage or any other html/php pages from windows machine. So it was the firewall who was stopping the incoming request. Can you please explain what is happening here? Since firewall rules are flushed, doesn't the system become vulnerable to security?

Thanx again. Regards.
Somen.
 
Old 07-24-2013, 10:14 AM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Its vulnerable now, because there is no firewall. But it proves that your firewall is the problem. For a default installation of Centos/SL6 that you want to run a webserver on, you can do this locally, DO NOT do this if you are ssh'd in, only do it LOCALLY:

Enable IPtables
Code:
service iptables start
chkconfig iptables on
Clear current IPtables policies
Code:
iptables -F
iptables -X
Put in some default rules to allow ssh and web traffic and localhost
Code:
iptables -P INPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
Check that iptables rules worked
Code:
iptables -L -v
Save iptables if so
Code:
service iptables save
I didnt write this out of memory,. i copy and pasted a lot from http://wiki.centos.org/HowTos/Network/IPTables which I suggest you take a look at to understand what is going on here.

Happy travels.

Last edited by szboardstretcher; 07-24-2013 at 10:16 AM.
 
1 members found this post helpful.
Old 07-24-2013, 10:17 AM   #6
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Running no firewall means that the system becomes more vulnerable to security, that's correct.
Depending on what other firewall you have you might not need one.
The safest is to only open for http & https.
Taken from memory: "iptables -A INPUT -p tcp --dport 80 -j ACCEPT"
will open for http.
 
1 members found this post helpful.
Old 07-26-2013, 03:24 AM   #7
somen.chanda
LQ Newbie
 
Registered: Sep 2007
Location: Kolkata, INDIA
Distribution: RHL7.3/8.0, RHEL V3
Posts: 5

Original Poster
Rep: Reputation: 0
Thumbs up Thanx a lot to all.

Many thanks friends, the suggestions worked fine. Now I want to setup a KOHA client-server system. The server will be my SL5 machine and the windows are clients. Since KOHA client interface is an web browser application, shouldn't I expect that it would run successfully with the current setup? Regards.

Somen.
 
  


Reply

Tags
apache, dsl, httpd, localhost, php


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache server does not respond to LAN http requests fedix Linux - Server 9 07-18-2012 03:51 PM
http server and wget from lan garry Slackware 3 05-31-2009 08:07 AM
Weird LAN Problem : Linux Vs. Windows , HTTP sites respond in Win and not in Linux duryodhan Slackware 21 11-03-2007 09:41 AM
HTTP Server Response Problems ... Web vs. LAN matrixcubed Linux - Networking 1 05-27-2007 01:39 PM
LAN/WAN IP address and http to virtual server behind DSL modem E-Rick Linux - Networking 3 10-19-2004 11:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration