VirtualHost overlap on port 443, the first has precedence

by antbrown on February 7, 2008

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.

{ 1 trackback }

virtualhost overlap on port 80
September 23, 2009 at 5:20 am

{ 14 comments… read them below or add one }

Computer Dude August 20, 2008 at 10:10 pm

Thanks, I was trying to figure this issue out for a while your post helped !

RHCE Candidate October 9, 2008 at 7:14 am

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`

Me September 6, 2009 at 7:23 pm

Thx, you save me !
Byebye !

Jose Antonio September 18, 2009 at 8:35 pm

Thanks, it helped :)

Alexis Wilke September 27, 2009 at 9:29 am

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

YomGuy October 23, 2009 at 11:17 am

Note that on Debian, this option is usually addable to /etc/apache2/ports.conf

Thanks !

Rick VanderHaas October 28, 2009 at 5:11 pm

Or change the NameVirtualHost *:443 into the site name, for example in your config:

YannicK November 17, 2009 at 7:23 pm

Thank you though, you shown up first in Google! 9-)
Nice ! Very Nice :p

immeƫmosol February 24, 2010 at 2:35 pm

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 …

immeƫmosol February 24, 2010 at 2:37 pm

That should have read,
something like (hopefully) the following:

<IfModule mod_ssl.c>
to
<IfModule ssl_module>

Justin Smithies March 7, 2010 at 6:57 pm

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.

Alexis April 24, 2010 at 8:40 pm

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 !

anon April 28, 2010 at 7:23 pm

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

Josh May 18, 2010 at 12:52 am

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.

Leave a Comment

Previous post:

Next post: