Https: lauches the root web folder rather than the subdomain folder


#1

I used Letsencrypt to set up https support with the command:

./letsencrypt-auto certonly -w /home/bitnami/htdocs/football -d football.brucekitto.com

What I am trying to do is to apply the certificate such that https://football.brucekitto.com is valid. But now when I go to http://football.brucekitto.com it is still find but https://football.brucekitto.com launches into the web pages in my root /home/bitnami/htdocs folder, not the football subdomain folder! I must have done something wrong for setting up a subdomain for HTTPS support but I’m stumped. Thanks for any help.

My domain is: football.brucekitto.com

I ran this command:

It produced this output:

My web server is (include version): Apacke

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is: Amazon Lightsail

I can login to a root shell on my machine (yes or no, or I don’t know): Yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): No


#2

Hi,

Please take a look at Bitnami’s official forum…

Thank you


#3

Unfortunately the links in the article you pointed me to did not work any more. The specific bookmarks are gone.

I was able to get it working pretty well by going into the apache2/conf/extras/httpd-vhost.conf file and, in addition to the existing entry looking on port 80 for the standard http: requests I added the following with the 443 port and with links to the certificates:

<VirtualHost *:443>
DocumentRoot “/opt/bitnami/apache2/htdocs/football”
ServerName football.brucekitto.com
SSLEngine on
SSLCertificateFile “/etc/letsencrypt/live/football.brucekitto.com/cert.pem”
SSLCertificateKeyFile “/etc/letsencrypt/live/football.brucekitto.com/privkey.pem”

The only thing I have left would be to re-route folks who enter the HTTP address over to the HTTPS site. Not 100% sure how to do that but it is not as critical. Thanks for taking the time to try to help!


#4

Hi @bkitto

find your vHost port 80. Add there something like

<VirtualHost *:80> 

	[other declarations]

	RewriteEngine On
	RewriteCond %{HTTPS} !=on
	RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]

</VirtualHost>

#5

You should use fullchain.pem instead of cert.pem.


#6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.