Help with ssl to my websites

Hello good afternoon
Could you help me ?, I followed the tutorial to add ssl to virtualmin to a virtual server
with Let’s Encrypt SSL option , webmin already works with https, but my websites like wordpress and moodle don’t. I have already done what is necessary in wordpress and moodle to migrate them to https, but I think the certificate is not being applied, someone could help me to make my certificate use with my sites in virtualmin, thanks !!

You should start by explaining what is happening or what not.^^

Thanks for your interest, what happens is that I have a virtual server, my site mydomain.com, and I want to have the moodle that I install there, with https, I followed the virtualmin tutorial on how to add an ssl and it works very well for me. which refers to webmin it already enters https however, when I enter my site mydomain / moodle it doesn’t work it doesn’t respond to me and it tells me page not found, if I remove the certificate and return everything to http, and I make the changes in moodle or wordpress so that they return to http if it works for me, how can I make my public_html sites use the certificate I generate for ssl?

You need to select the virtual server for the moodle installation and there you need to go to server configuration. There is an option called SSL certificate.
There you can request and enable SSL for your page.

I did it like this, but it doesn’t work for me, neither moodle nor wordpress

So you did request a certificate? If that worked, you should be able to access the page via https.

Yes, I tested, apply to webmin and if it answers me at https: // mydomain.com

You dont need to apply the cert for webmin. Only if that virtual server hosts the domain for the interface.
Otherwise you only need to request a certificate and then it should work.
If not: provide log files and explain the issues in detail please.

SuexecUserGroup "# /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (61)
ServerName secunda /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (62)
ServerAlias www.se /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (63)
ServerAlias mail.s /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (64)
ServerAlias webmai /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (65)
ServerAlias admin. /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (66)
DocumentRoot /home /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (67)
ErrorLog /var/log/ /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (68)
CustomLog /var/log /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (69)
ScriptAlias /cgi-b /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (70)
ScriptAlias /awsta /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (71)
DirectoryIndex ind /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (72)
<Directory /home/sec23/public_html>
Options -Indexes … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (74)
allow from all /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (75)
AllowOverride All … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (76)
Require all grant … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (77)
AddType applicati … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (78)
AddHandler fcgid- … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (79)
AddHandler fcgid- … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (80)
FCGIWrapper /home … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (81)
FCGIWrapper /home … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (82)

<Directory /home/sec23/cgi-bin>
allow from all /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (85)
AllowOverride All … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (86)
Require all grant … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (87)

RewriteEngine on /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (89)
RewriteCond %{HTTP … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (90)
RewriteRule ^(.) … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (91)
RewriteCond %{HTTP … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (92)
RewriteRule ^(.
) … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (93)
RemoveHandler .php /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (94)
RemoveHandler .php … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (95)
php_admin_value en /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (96)
FcgidMaxRequestLen … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (97)
SSLEngine on /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (98)
SSLCertificateFile /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (99)
SSLCertificateKey /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (100)
SSLProtocol all - /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (101)

AuthName "secund … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (103)
AuthType Basic /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (104)
AuthUserFile /ho … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (105)
require valid-us … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (106)

<Location /dav>
DAV on /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (109)
AuthType Basic /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (110)
AuthName "secund … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (111)
AuthUserFile /ho … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (112)
Require valid-us … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (113)
ForceType text/p … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (114)
Satisfy All /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (115)
RemoveHandler .p … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (116)
RemoveHandler .p … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (117)
RewriteEngine of … /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (118)

php_value memory_ /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (120)
IPCCommTimeout 41 /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (121)
SSLCACertificateF /etc/apache2/sites-available/myvirtualdomine.mydomine.com.conf (122)
Alias /dav /home/ /etc/apache2/sites-available/myvirtualdomine.mydomi

/var/log/virtualmin/mysubdomine.mydomine.com_error_log

[Tue Apr 21 12:08:32.682203 2020] [ssl:warn] [pid 17574] AH01906: mysubdomine.mydomine.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Apr 21 12:17:17.486974 2020] [ssl:warn] [pid 17574] AH01906: mysubdomine.mydomine.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Apr 21 12:17:21.321968 2020] [ssl:warn] [pid 17574] AH01906: mysubdomine.mydomine.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Apr 21 12:48:00.185711 2020] [core:alert] [pid 27066] [client 189.158.99.134:54748] /home/sec23/public_html/.htaccess: Invalid command ‘https://mysubdomine.mydomine.com’, perhaps misspelled or defined by a module not included in the server configuration
[Tue Apr 21 13:19:47.498793 2020] [core:alert] [pid 6086] [client 104.248.85.129:33692] /home/sec23/public_html/.htaccess: Invalid command ‘https://mysubdomine.mydomine.com’, perhaps misspelled or defined by a module not included in the server configuration
[Tue Apr 21 13:19:47.779309 2020] [core:alert] [pid 3274] [client 104.248.85.129:33720] /home/sec23/public_html/.htaccess: Invalid command ‘https://mysubdomine.mydomine.com’, perhaps misspelled or defined by a module not included in the server configuration

@claudio.tamez

hi, if you installed worpdress before apply ssl then you need to log into wp and in settings change link from http to https…when you press apply / save button it will re-generate htaccess and allow site to operate with ssl. I guess its same for moodle. You should know that issue is not really in virtualmin.

Yes I did install WordPress and moodle before generate ssl

I have already done what you recommend, but it still does not apply to sites, it only applies to webmin and virtualmin portals in https, any ideas?

is your domain “https://mysubdomine.mydomine.com/” ?
it’s hard tosay, if that is your domain the the SSL cert is for different domain. see details:
Brian

Web sites prove their identity via certificates. Firefox does not trust this site because it uses a certificate that is not valid for mysubdomine.mydomine.com. The certificate is only valid for the following names: *.parkingcrew.net, parkingcrew.net

I see that you mention “Copy to Webmin”

as mentioned above you only need to do that if this particular domain is to be used for webmin SSL access. otherwise you don’t copy the SSL cert for that purpose

1 Like

@claudio.tamez you do realize that each domain have own ssl… you can apply lets encrypt to domain without copying it to webmin virtualmin etc. When I usually use ssl I use it only for domain.com and www.domain.com and same goes for sub.domains.com. I also try to not to use wild cards meaning I am avoiding *.domain.com as there could be then problems…

1 Like

For Wordpress I had to install Really Simple SSL plugin through WP but then again I migrated a non-SSL WP site to a SSL site.

Thank you all for your interest,
Could you tell me the correct way to use the creation of certificates for my entire server and so my subdomains can be in ssl, the information found on How to add a wildcard or multi-domain SSL certificate, is a bit confusing, but I think it is what I am requiring, someone could give me a procedure a little bit clear and confirm if this would be my solution ?, greetings !!

Well I use one cerificat for each domain. But I have found it much easier to use certbot via ssh to handle it. I also had problems using Virtualmin to fix it. Via ssh it never fails. Set it up and forget