View Single Post
Old 02-25-2017, 06:16 PM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
You got root on the server?

Code:
LoadModule ssl_module modules/mod_ssl.so

Listen 443
<VirtualHost *:443>
    ServerName www.example.com
    SSLEngine on
    SSLCertificateFile "/path/to/www.example.com.cert"
    SSLCertificateKeyFile "/path/to/www.example.com.key"
</VirtualHost>
this is the way it is done

https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html
https://httpd.apache.org/docs/2.4/mod/mpm_common.html
Multiple Listen directives may be used to specify a number of addresses and ports to listen to. The server will respond to requests from any of the listed addresses and ports.

For example, to make the server accept connections on both port 80 and port 8000, use:
Code:
Listen 80
Listen 443
I added the Listen 443

that should* solve some of the problem -- I don't think that would redirect ALL requests to HTTPS/TLS 443
You don't want to use 301 redirection in a php script
or are you using an Apache .htaccess directive like Rewrite of Redirect Match

This is much simpler to do with Nginx


Configuring HTTPS servers


Code:

Code:
server {
  listen 80;
  listen 443 ssl;
  # force https-redirects
  if ($scheme = http) {
    return 301 https://$server_name$request_uri;
  }
}
2 ways to do it in Nginx
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote