Connection Timed out - Apache2/Ubuntu server. Why?

6,241

Solution 1

Are you sure that your router forwards connections made on the internal interface back into the internal network? It is very common that cheap routers only do the port forwarding on traffic that comes in on the external interface.

Try testing from outside your network and see if it works better.

Solution 2

The problem was closed ports.

Port forwarding options did not work on my router. I had to reset it to factory settings and set it up again. Now it works fine.

Why did my router fail to forward ports? No idea. But resetting router fixed the problem.

I'd like to thank @Eduardo and @pehrs for help!!

Solution 3

You either have problems with the port forwarding (that is: the packets arriving at your router are not reaching your server) or 443 is closed in the interface you're forwarding the packets to.

Try https://ip.being.forwarded.to/svn/repository-name locally (that is, in the server) with the IP you configured on your router. Does it work that way?

Also check for INPUT filtering (iptables -nvL INPUT). And post netstat -ntlp if possible.

Share:
6,241

Related videos on Youtube

loostro
Author by

loostro

Updated on September 18, 2022

Comments

  • loostro
    loostro almost 2 years

    I've managed to create SVN server that works on localhost (I used this tutorial).

    Checkout and all other commands work locally (when I use the adress https://localhost/svn/repository-name)

    I own a domain which points at my IP adress.

    ping mydomain.com 
    

    returns my IP adress.

    That IP adress leads to a router, which is configured to forward ports 80 and 443 to my server machine.

    Unfortunatelly checkout https://mydomain.com/svn/repository-name is not working (Connection Timed out).

    Why? Please help.

    My server machine is running Apache2 @ Ubuntu 10.10.

  • Eduardo Ivanec
    Eduardo Ivanec about 13 years
    +1 - this is a good possibility, do try it.
  • loostro
    loostro about 13 years
    https:// 192.168.0.109/svn/testPage/ returns my repository (just like https:// localhost/svn/testPage/)
  • loostro
    loostro about 13 years
    @pehrs how can I check this? My Router is D-Link DIR-100
  • loostro
    loostro about 13 years
    netstat -ntlp returns Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6601/apache2 tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1113/cupsd tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 6601/apache2 tcp6 0 0 ::1:631 :::* LISTEN 1113/cupsd
  • Eduardo Ivanec
    Eduardo Ivanec about 13 years
    Can you test the same from some other server in the LAN? You can access it via a browser if you haven't got a SVN client handy. If it works then you know the issue is with the router/port forwarding.
  • loostro
    loostro about 13 years
    iptables -nvL INPUT returns Chain INPUT (policy ACCEPT 30 packets, 4974 bytes) pkts bytes target prot opt in out source destination
  • Eduardo Ivanec
    Eduardo Ivanec about 13 years
    Test it from the internet, perhaps via VNC or rdesktop to your home? Or use some website like this one: yougetsignal.com/tools/open-ports
  • loostro
    loostro about 13 years
    I've tested it from another machine (plugged into the same router/in the same Local Area Network) and it works
  • loostro
    loostro about 13 years
    @Eduardo this website sais that my 80 and 443 ports are closed.. i guess thats the problem.. how do i open them?
  • Eduardo Ivanec
    Eduardo Ivanec about 13 years
    Double check your router config. This site may come handy: portforward.com/english/routers/port_forwarding/Dlink/DIR-10‌​0/…
  • loostro
    loostro about 13 years
    @Eduardo I re-entered & enabled following: Name: http IP Adress: 192.168.0.109 Public Port: 80 ~ 80 Private Port: 80 ~ 80 Traffic type: Any Name: ssl IP Adress: 192.168.0.109 Public Port: 443 ~ 443 Private Port: 443 ~ 443 Traffic type: Any checked again after router restart and the website still sais my ports are closed
  • loostro
    loostro about 13 years
    @Eduardo I also tried to set DMZ (Demilitarized Zone) to my server - it still didn't work :(
  • Eduardo Ivanec
    Eduardo Ivanec about 13 years
    I can't be of more help with this particular issue as I don't own a similar router, sorry.
  • pehrs
    pehrs about 13 years
    @Piotr No problem. Stick around and answer a few question and you soon have your 15 reputation ;)
  • loostro
    loostro about 11 years
    @Eduardo pehrs finally could give ya both thumbs up:)