Results 1 to 2 of 2

Thread: Apache2 not accessible from LAN

  1. #1
    Join Date
    Apr 2011
    Beans
    1

    Apache2 not accessible from LAN

    Hi there.

    I have a problem with apache server. The thing is - I can connect to my server on localhost, but when I try to connect from local network, it doesn't reply.

    I can ping my web server from lan. I can ssh my web server from lan.

    I haven't modified iptables since install except these commands>

    Code:
    iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d $MY_SERVER_IP --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
    iptables -A OUTPUT -p tcp -s $MY_SERVER_IP --sport 80 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
    
    iptables -A OUTPUT -p tcp -s $MY_SERVER_IP --sport 1024:65535 -d 0/0 --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
    iptables -A INPUT -p tcp -s 0/0 --sport 80 -d $MY_SERVER_IP --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
    I'm trying to implement dokuwiki and I'm pretty much stuck. I googled thoroughly, but nothing seems to work.

    Thanks for every idea.

  2. #2
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Apache2 not accessible from LAN

    The obvious step is to clear iptables and try the web server.

    iptables -F

    Those rules are nonsense anyway. A source port of 80 makes no sense. And having a rule that matches ESTABLISHED by itself also isn't useful at all. You can make them less confusing by leaving out wide open defaults such as 0/0 as they aren't needed.

    Just this will suffice, assuming the default is DROP,
    Code:
    iptables -A INPUT -p tcp -d $MY_SERVER_IP --dport 80 -j ACCEPT
    iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    Last edited by BkkBonanza; April 1st, 2011 at 02:00 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •