I'm running different websites on my webserver using Apache VirtualHosts. Now I have troubles getting one site to work. When I browse to the site in Firefox it says "Firefox can't find the server at www.mydomain.com", even though it's spelled correctly.

Further traceroute and ping both resolve to the correct IP, so I doubt it is because of a DNS issue.

I copied the VirtualHost-config file from a working site and just changed the domains and path on the server, which is existent. Further I checked that the site is enabled (with a2ensite), restartet apache, reloaded apache, but it is still not working.

Here's my VirtualHost-File:

<VirtualHost censored_ip:80>
  ServerName mydomain.com
  ServerAlias mydomain.com www.mydomain.com
  ServerAdmin <myemail>
  DocumentRoot /var/www/efin/
  <Directory /var/www/efin/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
  ErrorLog /var/log/apache2/error_efin.log
  LogLevel warn
  CustomLog /var/log/apache2/access.log combined
  ServerSignature On

I hope someone can find the error here, since I have no idea where to look for it anymore. Thanks a lot in advance. I'd be happy to provide further information if needed.

Sincerely, Michael

EDIT (3.8.2011): Actually I'm able to download files which are within /var/www/efin using .com/file.zip... Just entering .com doesn't work..

EDIT2 (3.8.2011): My domain is efinsolutions.com, maybe this helps when troubleshooting.

  • 1
    Please forgive a meta-comment, but - if this will be a publicly published website, what value is there in obfuscating the domain/IP? It merely makes it incrementally more difficult for those whose help you wish to have, to help you. – anastrophe Jul 28 '11 at 3:43
  • Actually you're right. I have no idea why I did obfuscate it. – Michael Kohler Aug 1 '11 at 15:01

There is no DNS record in place for www.efinsolutions.com, only for efinsolutions.com.

Going to just http://efinsolutions.com generates a '301 Moved Permanently' to www.efinsolutions.com, which doesn't exist.

Put a record in placed for www.efinsolutions.com, and it should start working.

|improve this answer|||||
  • Added the A record for www.efinsolutions.com and now it works. Thanks a lot! – Michael Kohler Aug 4 '11 at 13:46
  • If you're developing locally and having same problem you want to edit /etc/hosts :) – nuala Apr 8 '14 at 22:35

Try pinging from a different computer or even a computer connected to a different ISP, or use online DNS tools because it does look like a DNS issue, and correct IP is simply cached by your OS.

|improve this answer|||||
  • DNS doesn't seem to be the problem here, since it resolves correctly to my server's IP. A friend of mine tested it. Thanks anyway. – Michael Kohler Aug 1 '11 at 15:24

I would suggest changing "<VirtualHost censored_ip:80>" to "<VirtualHost *:80>".

|improve this answer|||||
  • I second this. I thought that this is an ipbased site, but looking closely, it looks more like a name-based site. – Rilindo Jul 28 '11 at 3:33

Whenever you have vhost trouble with Apache, always always examine the output of:

httpd -S

It should give you a clue as to what's wrong.

|improve this answer|||||
  • Somehow I don't have this command.. Where is this script located? – Michael Kohler Aug 1 '11 at 15:26
  • 1
    It's not a script - it's the actual apache binary. It may be called something different (apache2 for instance) on your system. – MikeyB Aug 1 '11 at 15:55
  • Have you run 'apache2ctl configtest' (which may highlight some issue(s))?
  • Is there anything showing up in the error/access log(s) - it might help creating a separate error/access log for the new site, and checking those files
  • If the server is busy, Apache may not restart straight away (at least if you've done an apache2ctl graceful). Do an explicit 'apache2ctl stop', 'ps auxwww | grep apache2 ' and make sure it's gone away... then start.
  • Putting the IP address before the :80 in the VirtualHost tag shouldn't be a problem, as long as you've got a NameVirtualHost ip.add.re.ss:80 in /etc/apache2/ports.conf. I think I've seen issues in the past where Apache gets confused if I've mixed '*:80' and 'x.x.x.x:80' style definitions.
|improve this answer|||||
  • Syntax ist OK. Also there is nothing suspicious showing up in the log. Further restarting apache2 like that didn't help either. I'm really confused.. – Michael Kohler Aug 1 '11 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.