VirtualHost overlap on port 443, the first has precedence

This is the warning I was getting:

[warn] _default_ VirtualHost overlap on port 443,
the first has precedence

Go here for the solution to virtualhost overlap on port 80, it’s almost exactly the same.

And, this is how to fix the warning:

Add this line of code to your configuration file (usually httpd.conf or httpd-vhosts.conf)

NameVirtualHost *:443

I already had the line: “NameVirtualHost *:80″ which allowed me to have virtual hosts on the port 80, However later on I added a Virtual Host that operated on port 443 over SSL and I didn’t realize that I needed the line above.

I kept getting the same warning whenever I (re)started Apache but it didn’t seem to hinder the operation of anything so I left it at that.

Now it all boots up nice and clean, so I’m happy.

Hope this helps, I can’t say this will help in all instances of that warning, but it certainly fixed it up for me.

34 thoughts on “VirtualHost overlap on port 443, the first has precedence

  1. Thanks for your posting. This is the sort of thing one never remembers (how often do we set-up this sort of thing?!?). Concise and helpful — `chown -R ant ~/base`

  2. Pingback: virtualhost overlap on port 80

  3. Wow! I had that line commented because in the previous version of 2.x that I was running having that line turn ON created an error. So in other words they inverted the definition of the NameVirtualHost function…

    And also I do not have it for port 80 and yet port 80 works just fine. Again, I’m surprised…

    Thank you though, you shown up first in Google! 9-)
    Alexis

  4. Didn’t work here (Ubuntu Jaunty),
    in /etc/apache2/ports.conf it says
    that NameBased VirtualHosts are not yet supported.

    `Fixed` it by changing

    to

    … :S
    little things …

  5. Thanks for that , that error was driving me nuts ! Still took a while to find where to put it in Ubuntu 9.04 . It goes in /etc/apache2/ports.conf just add the NameVirtualHost *:443 even though the comments in the file say its not supported it does work.

  6. Wow, thanks. Upgrading from Apache 2.2.11 to 2.2.15 in Gentoo this fixed everything…

    Unfortunatelly it took me two hours to find this post.

    Thanks !

  7. thanks. easy to read. concise, to the point. unlike other sites where you have to read 10 pages before they get to the point.

  8. For me, the solution was making sure I didn’t have multiple “Listen 80 / Listen 443″ declarations in the various *.conf files I was loading.

  9. For me, this occurred when I copied /etc/httpd/conf.d/ssl.conf to /etc/httpd/conf.d/ssl_Orig.conf and restarted the httpd daemon. It seems that all *.conf files in the /etc/httpd/conf.d directory are processed even if the name was made up. So the apache server got confused since the same commands were issued twice. I fixed it by moving my backup, “/etc/httpd/conf.d/ssl_Orig.conf” to another directory and restarting httpd.

  10. yarb nice post, top on google for the phrase “_default_ VirtualHost overlap on port 443, the first has precedence”. just wanted to add my thanks to the pile. (the port 80 setting is in ports.conf in this 10.4 ubuntu/apache2 setup, put the 443 setting in there too :)

  11. Pingback: Virtual hosts overlap on 443, first has precedence « Baddý and Christoph's Blog

  12. Thanks Ant. Worked like a charm! And like BladeMcCool said, if you’re using Apache 2 on Ubuntu, you should add the NameVirtualHost directive to the file /etc/apache2/ports.conf. I started getting this warning when I applied an additional SSL certificate to another site hosted on the same server.
    Adding a container for that particular domain caused the “[warn] _default_ VirtualHost overlap on port 443,
    the first has precedence” warning. I’m glad it’s fixed now! Thanks again!

  13. Pfft!!! My copy of the configuration file (and yes, for me, it too was in /etc/apache2/ports.conf) said there wasn’t support for NameVirtualHost on SSL yet.

    But following this advice made the warning message go away.

    Thank you very much.

  14. I run apache2 on ubuntu 10.10 and I added NameVirtualHost *:443
    to /etc/apache2/apache2.conf this fixed my error.

  15. Amazing!

    The same here: Ubuntu 10.10 and Apache2. Worked :) Now I can enjoy https addresses :) Thank you!

  16. Thanks, that fixed the issue!

    In SuSE/SLES the file is named
    /etc/apache2/listen.conf
    instead of ports.conf

  17. Thanks, this post has just been a big help. Love it when an answer just gets straight to the point.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">