4

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
  </Directory>
  ErrorLog /var/log/apache2/error_efin.log
  LogLevel warn
  CustomLog /var/log/apache2/access.log combined
  ServerSignature On
</VirtualHost>

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.

2
  • 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, 2011 at 3:43
  • Actually you're right. I have no idea why I did obfuscate it. Aug 1, 2011 at 15:01

5 Answers 5

2

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.

2
  • Added the A record for www.efinsolutions.com and now it works. Thanks a lot! Aug 4, 2011 at 13:46
  • If you're developing locally and having same problem you want to edit /etc/hosts :)
    – nuala
    Apr 8, 2014 at 22:35
2

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.

1
  • 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. Aug 1, 2011 at 15:24
1

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

1
  • 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, 2011 at 3:33
1

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.

2
  • 1
    Somehow I don't have this command.. Where is this script located? Aug 1, 2011 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, 2011 at 15:55
0
  • 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.
1
  • 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.. Aug 1, 2011 at 15:31

You must log in to answer this question.

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