0
votes

I have managed to redirect a subdomain hosted on my host provider (1and1) to an EC2 instance on AWS by implementing the following steps:

  • creating an elastic IP on my EC2 instance
  • adding the elastic IP address to the DNS settings of my subdomain

Question: How can I now allow for https request? The subdomain has a working SSl certificate but when I call the https://mysubdomain.example.com I am getting the following error:

This site can't be reached, mysubdomain.example.com refused to connect.

The security group setup on my EC2 instance allows for https, although it seems that the port 443 is not correctly open as typing:

sudo netstat -tlnp

returns:

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      10144/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      3081/master
tcp6       0      0 :::80                   :::*                    LISTEN      16084/httpd
tcp6       0      0 :::22                   :::*                    LISTEN      10144/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      3081/master

Any idea? The EC2 instance is running on an Apache VirtualHost. Many thanks.

I am running on Apache and the .conf looks like this:

<VirtualHost *:80>

    Servername xx.xx.xx.xx

    WSGIPassAuthorization On
    WSGIDaemonProcess bottle_app threads=5 python-path=/var/www/bottle_app/:/usr/lib/python2.7/site-    packages/:/usr/lib64/python2.7/site-packages/

    WSGIScriptAlias / /var/www/bottle_app/app.wsgi

    <Directory /var/www/bottle_app>
        WSGIProcessGroup bottle_app
        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptReloading On
        Order deny,allow
        Allow from all
        # Require all granted
    </Directory>

    ErrorLog /var/log/httpd/errors.log
    CustomLog /var/log/httpd/requests.log combined

</VirtualHost>
1
Which operating system are you running? Is there a firewall blocking the port 443? Can you post your Apache configuration?Oswin Noetzelmann
Oswin, just added requested infos re Apache confStephane B.
I have added an answer below. Hope that helps.Oswin Noetzelmann

1 Answers

0
votes

Your virtualhost configuration for Apache indicates that you serve only on port 80 and dont have tls set up. You need to generate or acquire a certificate and set up the https access in Apache. Please read the following articles. If you use a self-generated certificate it will not be trusted by browsers.

How to set up https in Apache

How to get a free trusted certificate with let's encrypt