Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

Apache/2.4.38 serving wrong certificate file

Post new topic   Reply to topic    Apache Forum Index -> Apache

View previous topic :: View next topic  
Author Message

Joined: 25 Mar 2019
Posts: 2
Location: UK,Luton

PostPosted: Mon 25 Mar '19 23:15    Post subject: Apache/2.4.38 serving wrong certificate file Reply with quote

I have an Apache/2.4.25 site serving https for virtualhosts quite happily.

I have a new server using Apache/2.4.38 and a very similar, but smaller, config to the other machine.

When I access a website on the new machine the certificate the browser gets is the default one for localhost, not the one for the virtual domain. (and hence complains about the certificate)

There are no errors reported on starting apache or when the site is accessed.

ssl.conf on both machines is the same and has the directives for server localhost certificate enabled.
The permissions for the domain cert key is root rw only

I can't seem to get any closer than that.

Anyone have any ideas on how to pin down this problem further?

Thanks for your time.
Back to top
James Blond

Joined: 19 Jan 2006
Posts: 6597
Location: Germany, Next to Hamburg

PostPosted: Wed 27 Mar '19 16:22    Post subject: Reply with quote


sudo apache2ctl -S
to check the vhost config and see why localhost is the default 443 vhost.
Back to top

Joined: 25 Mar 2019
Posts: 2
Location: UK,Luton

PostPosted: Thu 28 Mar '19 19:18    Post subject: Reply with quote

Thanks for that!
My server doesn't have apache2ctl only apachectl, and the man page doesn't mention -S.
However apachectl -S works for me!

It would have saved me a lot of time to have used that command.

As it turns out, everything was working as it should, just that in taking too many shortcuts I had the servername the same as the virtual site. Once I'd set up a different name for the virtual site it worked as I'd hoped.
Back to top

Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1