1b. Install Apache, PHP, localhost SSL (https) On Windows 10, all newest 64 bit

HOME
Download config and php test files:  0_Apache24_conf_extra_PHP_ini.zip

Everything works. If I forgot something see URL-s in this article wich served me as tutorials. ZWAMP or simmilar and virtual hosts are not used for this basic example – Apache and PHP are extracted in C: .

Output of C:\Apache24\htdocs\index.php
(see 0_Apache24_conf_extra_PHP_ini.zip) :

Glavni izbornik (Home)

 HTML 5, CSS 3, JS, SSL.                                                             Help
1111111111 2222222222 3333333333 4444444444   444444      Home refresh (http)
4444444444 4444444444 4444444444                                        Home https

C:\Apache24\htdocs\index.php says: JS says: location.protocol=https:

 

https://www.proy.info/how-to-enable-localhost-https-on-wamp-server/
Posted On May 19th, 2017

I did mostly see below Masim Man Dec 1, 2016
1. HOW TO SET UP APACHE WITH SSL (HTTPS) ON LOCALHOST
but URL above has some clearer configs

Step 1: Download and unpack Apache lounge 64 bit (Windows 10 64 bit)
and PHP Version 7.1.9 non thread safe
httpd-2.4.27-Win64-VC15.zip, mod_fcgid-2.3.9-win64-VC15.zip
php-7.1.9-nts-Win32-VC14-x64.zip
SEE HOW TO UNPACK zip-s above : https://www.dionysopoulos.me/233-apache-mysql-php-server-on-windows-with-multiple-simultaneous-php-versions.html
or 0_Apache24_conf_extra_PHP_ini.zip above.

we have C:\Apache24 and C:\PHP\7.1.9

Step 2: Download OpenSSL (32 bits/64 bits Windows)
I did not so, see below Masim Man Dec 1, 2016

Step 3: Configure WAMP to use HTTP+SSL=HTTPS
I did not so, see below Masim Man Dec 1, 2016

Step 4: Create SSL Key and Certificate
I did not so, see below Masim Man Dec 1, 2016

Step 5: Copy the Created SSL Key and Certificate file
I did not so, see below Masim Man Dec 1, 2016

Step 6: Open httpd.conf, php.ini & uncomment
Open C:\Apache24\conf\httpd.conf and uncomment:
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
See whole scripts in .zip above.

Step 7: Open httpd-ssl.conf and make the final changes
Open c:\Apache24\conf\extra\httpd-ssl.conf (see .zip above)
find “<VirtualHost _default_:443>” and below that line find and update below configuration according to your setup:
# General setup for the virtual host
DocumentRoot “c:/Apache24/htdocs”
#ServerName www.example.com:443
ServerName localhost:443
ServerAdmin youremail
ErrorLog “c:/Apache24/logs/sslerror.log”
TransferLog “c:/Apache24/logs/sslaccess.log”
SSLEngine on
SSLCertificateFile “c:/Apache24/conf/server.crt”
SSLCertificateKeyFile “c:/Apache24/conf/server.key”
… and so on, see config files in 0_Apache24_conf_extra_PHP_ini.zip.

Open php.ini, uncomment :
extension=php_openssl.dll

Step 8: Test to make sure it works
check if you are getting Syntax is OK
C:\Apache24\bin>httpd -t
https://localhost/index.php

 

https://www.youtube.com/watch?v=Zdl68h_N2lc Masim Man Published on Dec 1, 2016 :

HOW TO SET UP APACHE WITH SSL (HTTPS) ON LOCALHOST

HTTPS (Hyper Text Transfer Protocol Secure) is a protocol for secure communication over a computer network.

Make icon for C:\Windows\SysWOW64\cmd.exe (run as admin). It shows Apache’s openssl:
openssl version -d
OPENSSLDIR: “C:\Program Files\Common Files\SSL”
openssl version
OpenSSL 1.1.0f 25 May 2017

–We create files :
1. C:\Apache24\conf\server.csr              <–OpenSSL certificate request
2. C:\Apache24\conf\server.pem            <–private key

3. C:\Apache24\conf\server.key             <–from .pem
4. C:\Apache24\conf\server.crt              <–from .key, .csr
see  below :
openssl x509 -req -signkey C:\Apache24\conf\server.key -days 1024 ^
-in C:\Apache24\conf\server.csr -out C:\Apache24\conf\server.crt

00000 –INITIAL
Change config path to where you have installed Apache :
cd C:\Apache24\bin
set OPENSSL_CONF=C:\Apache24\conf\openssl.cnf

11111 & 22222 —     ^ = ALTGRKEY+3 (3 two times)
openssl req -config C:\Apache24\conf\openssl.cnf -new ^
   -out C:\Apache24\conf\server.csr -keyout C:\Apache24\conf\server.pem
ANSWERS: only two :
writing new private key to ‘C:\Apache24\conf\server.pem’
Enter PEM pass phrase: test1
Common Name (e.g. server FQDN or YOUR name) []:localhost

33333
openssl rsa -in C:\Apache24\conf\server.pem -out C:\Apache24\conf\server.key
ANSWER: Enter pass phrase for C:\Apache24\conf\server.pem:test1
writing RSA key

44444
openssl x509 -req -signkey C:\Apache24\conf\server.key -days 1024 ^
    -in C:\Apache24\conf\server.csr -out C:\Apache24\conf\server.crt
Outputs:
Signature ok
subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = localhost
Getting Private key

55555
–C:\Apache24\conf\httpd.conf
search ssl, listen, httpd-ssl and uncomment :
LoadModule log_config_module modules/mod_log_config.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so

Listen 80
#live commented <IfModule mod_ssl.c>
Listen 443
#</IfModule>

Include conf/extra/httpd-ssl.conf

C:\Apache24\conf\extra\httpd-ssl.conf
SSLSessionCache “shmcb:c:/Apache24/logs/ssl_scache(512000)”

restart Apache
if will not start:  as sdmin in CLI
C:\Apache24\bin>httpd -t
or :
NOT httpd.exe -k restart but so:
C:\Apache24\bin>httpd.exe  — this shows error message

 

————– NEEDED FOR MS INET BROWSERS :
https://www.youtube.com/watch?v=Hhown6DgC00 Masim Man Published on Dec 2, 2016
HOW TO INSTALL AN APACHE SELF SIGNED CERTIFICATE ON WINDOWS 10
On Windows 10, a Self Signed Certificate that wasnt issued by a recognized certificate authority is not trusted by default. A Self Signed Certificates usually used on Local Web Servers (Localhost) that arent available publicly. In this case you are save to
– bypass the warning on any browsers
– or installing it to a trusted root certification authority in Windows 10.
2click C:\Apache24\conf\server.crt
in Certificate dialog Issued to and Issued by is localhost
click button “Install certificate”
for current user
place in store “Trusted root Cert. Authorities”
remove certificate localhost so:
WINKEY -> mmc -> File -> Add/remove snapp-in -> Certificates
-> Add -> My user account

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.