1

We have a development webserver (ubuntu) with some websites running on it. Most of the time this works fine but since some time when we are developing we get a "cannot connect" error when loading a webpage, nothing special, even on a simple html page. A page that a minute ago worked fine, this lasts for a couple of minutes and after which it starts working again.

So for a couple of minutes we cannot connect to our server with http request, ssh for example works fine. We monitored the server load but this remains 0.03 the entire time.

We thought the problem would be Apache or Mysql but even after restarting them both the server stayed unreachable.

Update: When the server is unreachable via the domain name, it still works when we use the ip adres of the server. So I don't think the server itself is the problem, but something in the dns our on the router.

Anyone an idea what the problem could be?

3
  • Are there any interesting/relevant messages in your logs when this happens /var/log/apache2/error.log /var/log/apache2/access.log failing them /var/log/* ?
    – user9517
    Jan 14, 2013 at 11:10
  • no, the requests made aren't showing up in the logs but except for that nothing is happening.
    – dazz
    Jan 14, 2013 at 11:33
  • Then they were not made. All requests are logged.
    – adaptr
    Jan 14, 2013 at 13:04

2 Answers 2

0

You want to monitor apache with the built-in server-status module:

http://httpd.apache.org/docs/2.2/mod/mod_status.html

Make sure you also set ExtendedStatus On in your global config (not in a vhost).

You can then check if there are long-running requests, or if your workers are being depleted.

2
  • no nothing going on, 9 idle workers and no long-running requests
    – dazz
    Jan 14, 2013 at 13:03
  • Based on your response above, I doubt your ability to judge this :) Add some information to your post, such as: MPM used, memory usage/availability, MPM settings (min/max servers etc.)
    – adaptr
    Jan 14, 2013 at 13:05
0

When the server is unreachable via the domain name, it still works when we use the ip address of the server. So I don't think the server itself is the problem, but something in the dns our on the router.

Anyone an idea what the problem could be?

Note: this depends on the server returning ping packets to be a useful test. Your server may be configured not to for "security reasons" (although it really doesn't buy you very much security.)

When the condition is occurring (and the server is not responding to your http or https requests) can you ping the server by hostname? If so, your ping command is successfully resolving the server address via DNS (i.e. not a DNS problem) and your router is passing the ICMP echo request through to the address (i.e. not a router problem.) So if ping works, you should concentrate on the server as the likely culprit.

If ping does not work, troubleshoot as a normal network problem (e.g. look at DNS resolution, try traceroute to see if your connection attempt is dying somewhere along the way, etc.)

Late edit:

I missed that you wrote:

So for a couple of minutes we cannot connect to our server with http request, ssh for example works fine.

I can't tell for sure from your description above whether you mean "ssh servername.domain.tld" works fine while the outage is occurring or whether you just mean that if you are ssh'ed into the server when an outage condition occurs your ssh connection does not drop. If you can remain ssh'ed in and actively connected (i.e. not just judging that you are connected because your ssh connection doesn't drop) while this condition is occurring it is not likely to be a router problem. And it should be very easy to test DNS resolution by using a program like dig (or nslookup, but dig is greatly superior once you learn to use it.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .