I have a CentOS 6 VPS with 5 sites and Let's Encrypt installed and working on all sites. When I access https://vps-ip, it always points to the first site configured in vhosts-ssl-letsencrypt.conf (I've changed the config and put another site at the top of the config to test it). I've tried to add:

<VirtualHost ip:443>
    ServerName ip
    Redirect 403 /
    ErrorDocument 403 "No"
    DocumentRoot /usr/local/apache/htdocs
    UseCanonicalName Off
    UserDir disabled

but sites are not accessible via ssl

or <VirtualHost *:443>... 

gives me this error: [error] Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] ((null):0)

<VirtualHost *>...

no change

http://vps-ip is pointing to the right vps welcome page. Any ideas?


The simple answer is you have not enabled SSL for your *:443 vhost in the question above. Apache doesn't suddenly start talking SSL for a vhost just because you put it on port 443, it needs configuring.

Also this directive is not one that will do anything sensible:

 Redirect 403 /

And you should not use

<VirtualHost *>

That will cause all sorts of problems. Use IP:port or *:port and nothing else. Also do not mix these two types of arguments unless you know exactly what you are doing.

EDIT: In response to the first comment: Add a default SSL virtual host. It must be the first one listed for port 443 in the output of apachectl -S and add the IP address as the ServerName or a ServerAlias

EDIT2: In response to further comments. It would seem you have not enabled SSL. There are an absolute minimum of three SSL directives you need in your virtual host to enable SSL, they are detailed here: http://httpd.apache.org/docs/current/ssl/ssl_howto.html

  • SSL is enabled, working both on domain.tld and ip which points to the first site in my vhosts-ssl-letsencrypt.conf. I want the ip to point to the VPS welcome page not a domain. – Dan Oct 11 '16 at 13:58
  • Add the output of apachectl -S to your post. I've also added a possible solution to my answer. – Unbeliever Oct 11 '16 at 14:24
  • Sorry for the late reply: >apachectl -S httpd: Could not reliably determine the server's fully qualified domain name, using vpsxxx.ovh.net for ServerName VirtualHost configuration: wildcard NameVirtualHosts and default servers: default:443 vpsxxx.ovh.net (/etc/httpd/conf.d/ssl.conf:74) Syntax OK – Dan Oct 28 '16 at 10:21
  • I have this in ssl.conf: Listen 443 SSLProtocol .... SSLHonorCipherOrder on SSLCipherSuite ..... NameVirtualHost ip:443 – Dan Oct 28 '16 at 10:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.