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

I have a debian server with one IP and three projects linking to the same folder. Within the VirtualHosts I have some different alliases. I now want to redirect some parts to HTTPS. For one project this works fine (see below) but I have problems for the other projects. I have a Multi Domain Certificate for all three projects.

Module ssl und rewrite are working.

NameVirtualHost *
Listen 80
Listen 443


<Directory /home/projekt/>
   Allow from all
   AllowOverride All
   Order allow,deny
   Options FollowSymLinks
</Directory>

<VirtualHost *:80>
   ServerAdmin     support@projekt
   DocumentRoot    "/home/projekt/cfdocs"
   ServerName      local-projekt.com
[..]
</VirtualHost>

<VirtualHost *:80>
   ServerAdmin     support@projekt
   DocumentRoot    "/home/projekt/cfdocs"
   ServerName      projekt-de.com
[..]
</VirtualHost>

<VirtualHost staticIP:443>
   ServerAdmin     support@projekt
   DocumentRoot    "/home/projekt/cfdocs"
   ServerName      projekt-de.com

   SSLEngine On
   SSLCertificateFile /etc/ssl/www_.crt
   SSLCertificateKeyFile /etc/ssl/www_.key
   SSLCertificateChainFile /etc/ssl/www_.ca-bundle
   ServerSignature On

[..]
</VirtualHost>

<VirtualHost *:80>
   ServerAdmin     support@projekt
   DocumentRoot    "/home/projekt/cfdocs"
   ServerName      projekt-fr.com
[..]
</VirtualHost>

<VirtualHost *:80>
   ServerAdmin     support@projekt
   DocumentRoot    "/home/projekt/cfdocs"
   ServerName      projekt-it.com
[..]
</VirtualHost>

As I said, this works for projekt-de fine. But I cannot copy the VirtualHost for the other projects, the error message is

"VirtualHost staticIP:443 overlaps with VirtualHost staticIP:443, the first has
precedence, perhaps you need a NameVirtualHost directive"

I am not sure, what this means.. I read the documentation and I thought http://213.11.80.10/manual/vhosts/examples.html#ipport is the same thing as I have / need.

Thanks for any hints, I already spent some hours with testing..

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Try swap the first line of the config for:

NameVirtualHost *:80
NameVirtualHost staticIP:443

as the argument to the VirtualHost directive must exactly match the argument to the NameVirtualHost directive

share|improve this answer
    
I now use NameVirtualHost *:80 NameVirtualHost *:443 Listen 80 Listen 443 And the <VirtualHosts *:443> and the error messages are gone.. Thank you very much! –  da_didi Jun 23 '10 at 13:19

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.