Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

/etc/apache2/conf.d/virtul.conf :

NameVirtualHost *

In the first file of sites-enabled/website1.org you'll see a group such as:

<VirtualHost *>
    ServerName website1.org
</VirtualHost>

And the same for website2.org

The domain (and subdomains) located in website1.org work exactly how they should. However, nothing works for website2.org. When visiting website2.org in a browser I get a 500 Internal Server Error

Two notes: 1) When running # /etc/init.d/apache2 restart I get:

 * Restarting web server apache2                                                [Tue Jul 24 09:31:59 2012] [warn] NameVirtualHost 72.10.54.89:80 has no VirtualHosts
 ... waiting [Tue Jul 24 09:32:00 2012] [warn] NameVirtualHost 1.23.456.769:80 has no VirtualHosts

2) website2.org has an ssl cert and that ssl VH is set up as sites-enabled/website2.org-ssl

FYI yes I ran a2ensite for every domain, followed by an apache reload and after all were setup I did an apache restart.

What can I do to get my second website live? I'm not sure what to check next.. Thx for help.

** edit @RedFoxy **

 * Restarting web server apache2                                                   [Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] NameVirtualHost 72.10.54.89:80 has no VirtualHosts
[Tue Jul 24 10:56:57 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
 ... waiting [Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] NameVirtualHost 72.10.54.89:80 has no VirtualHosts
[Tue Jul 24 10:56:58 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
share|improve this question
    
And you have an IP for each website or you want them served on the same IP address? –  Mathias R. Jessen Jul 24 '12 at 16:57
    
Good point. Everything is name based on the same IP. –  Jackson Jul 24 '12 at 17:00

1 Answer 1

It's simple, just you must specify the port as:

NameVirtualHost *:80

and

<VirtualHost *:80>
    ServerName website1.org
</VirtualHost>

Remember to change :80 with the web port that you need

share|improve this answer
    
I don't think that's allowed because the format is not *:80 since one of the sites is :443. It didn't fix the problem anyway. –  Jackson Jul 24 '12 at 17:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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