Tuesday, November 3, 2015

apache 2.2 - Apache2, VirtualHosts, SSL, Mutli Domain Certificate



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



Allow from all
AllowOverride All
Order allow,deny
Options FollowSymLinks




ServerAdmin support@projekt
DocumentRoot "/home/projekt/cfdocs"
ServerName local-projekt.com
[..]



ServerAdmin support@projekt
DocumentRoot "/home/projekt/cfdocs"

ServerName projekt-de.com
[..]



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

[..]



ServerAdmin support@projekt

DocumentRoot "/home/projekt/cfdocs"
ServerName projekt-fr.com
[..]



ServerAdmin support@projekt
DocumentRoot "/home/projekt/cfdocs"
ServerName projekt-it.com
[..]




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..


Answer



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



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...