Host SSL Centos 7

Started by Vitech_Team, April 12, 2017, 01:45:34 AM

Previous topic - Next topic

Vitech_Team

How to SSL the host?, I tried several ways and I can't get it done. The wiki page is outdated since /usr/local/cwpsrv/conf.d/cwp-ssl.conf doesn't exist. Also the latest version states not to use letsencrypt and use SSL Cert Manager instead.

Any Ideas or guides on how to get this done?

Thanks.

tshetumd

Quote from: Vitech_Team on April 12, 2017, 01:45:34 AM
How to SSL the host?, I tried several ways and I can't get it done. The wiki page is outdated since /usr/local/cwpsrv/conf.d/cwp-ssl.conf doesn't exist. Also the latest version states not to use letsencrypt and use SSL Cert Manager instead.

Any Ideas or guides on how to get this done?

Thanks.

Please edit /usr/local/cwpsrv/conf/ cwpsrv.conf
and
Replace  " ssl_certificate     /etc/pki/tls/certs/hostname.crt;
             ssl_certificate_key /etc/pki/tls/private/hostname.key; "

with your certificate .


Thanks

Vitech_Team

Thank you for your answer.

What certificate you replaced with? How do I create a valid SSL certificate? Using Letsencrypt or auto ssl now?

Thanks.

tshetumd

Quote from: Vitech_Team on April 12, 2017, 09:39:31 AM
Thank you for your answer.

What certificate you replaced with? How do I create a valid SSL certificate? Using Letsencrypt or auto ssl now?

Thanks.

using letsencrypt .. replace with
     ssl_certificate /etc/letsencrypt/live/yourhostname/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/yourhostname/privkey.pem

Thnaks

Vitech_Team

Ok, so. This is what I did.

Fresh centos 7 minimal installation with the latest CWP (0.9.8.304)

First I added this.

# vhost_start host.hostname.com
<VirtualHost SERVER-IP:80>
ServerName host.hostname.com
ServerAlias www.host.hostname.com
ServerAdmin xyz@mail.com
DocumentRoot "/usr/local/apache/htdocs/"

<IfModule mod_suexec.c>
        SuexecUserGroup nobody nobody
</IfModule>

<IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
</IfModule>

<Directory "/usr/local/apache/htdocs">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end host.hostname.com


Restarted apache

Second I installed Letsencrypt and did this:
Domain : host.hostname.com
Path : /usr/local/apache/htdocs/
UserName : nobody
Email : youremail@xyz.com
IP : your Server IP
Port : 443

and this is the error I got now.


Failed authorization procedure. host.hostname.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://host.hostname.com/.well-known/acme-challenge/4k1GJb96Spl1tAjzt-GxQjCxDsSEnWQfsq_pNlxJhxU: "

Administrator

hostname certificate with autoSSL is generated when you change your hostname