I have just purchased an SSL certificate from Go Daddy. I setup the certificate to be:
www.mydomainname.com (I changed the domain as you can tell.)
I setup Apache and it is working. So when I type https://www.mydomainname.com
it all works.
HOWEVER:
When I type http://www.mydomainname.com
I get this error from Apache:
Bad Request
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
I was hoping I could type
http://www.mydomainname.com
for HTTP requests
and
https://www.mydomainname.com
when I want secure requests.
What have I done wrong?
Here is my Apache configuration:
Under sites-enabled (I am using Ubuntu's Apache setup)
I have file called ssl
<IfModule mod_ssl.c>;
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/www.mydomainname.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/www.mydomainname.com.key
</IfModule>
and another called webapp
:
<IfModule mod_proxy_ajp.c>
ProxyRequests On
ProxyVia On
<Location />
Order allow,deny
Allow from all
AuthType Basic
AuthName "Restricted area"
AuthUserFile /etc/apache2/passwd/access
Require valid-user
ProxyPass ajp://localhost:9999/
ProxyPassReverse ajp://localhost:9999/
</Location>
<Location /uploader>
Order allow,deny
Satisfy Any
Allow from all
ProxyPass ajp://localhost:9999/uploader
ProxyPassReverse ajp://localhost:9999/uploader
</Location>
</IfModule>