https xampp multiple ssl Websites

https xampp multiple ssl Websites


https xampp multiple ssl Websites in this tutorial i will show to you how to config HTTPS with virtual hosts on XAMPP and httpd-ssl.conf .

Before start Plz save all your xampp folder .

Lets Start This Xampp Tutorial 2019 :

First we have 2 ssl Websites installed :
 1)www.website001.com installed on C:/xampp/htdocs
1) i make a folder named ssl and i past my ssl crt and key files
C:/xampp/htdocs/ssl/server.crt
C:/xampp/htdocs/ssl/server.key
2)www.website002.com installed on C:/xampp/htdocs/htdocs2
2) i make a folder named ssl and i past my ssl crt and key files
C:/xampp/htdocs/htdocs2/ssl/server.crt
C:/xampp/htdocs/htdocs2/ssl/server.key
Go to C:\xampp\apache\conf\extra

Edit this File httpd-ssl.conf remove all and remplace with This code :

Listen 443
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLHonorCipherOrder on
SSLProtocol all -SSLv3
SSLProxyProtocol all -SSLv3
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:C:/xampp/apache/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
<VirtualHost _default_:443>
DocumentRoot "C:/xampp/htdocs"
ServerName www.website001.com:443
ServerAdmin admin@website001.com
SSLEngine on
SSLCertificateFile "C:/xampp/htdocs/ssl/server.crt"
SSLCertificateKeyFile "C:/xampp/htdocs/ssl/server.key"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "C:/xampp/apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
#CustomLog "logs/ssl_request.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
# Per-Server Logging:
# The home of a custom SSL log file. Use this when you want a
# compact non-error SSL logfile on a virtual host basis.
#CustomLog "C:/xampp/apache/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
<VirtualHost _default_:443>
DocumentRoot "C:/xampp/htdocs/htdocs2"
ServerName www.website002.com:443
ServerAdmin admin@website002.com
SSLEngine on
SSLCertificateFile "C:/xampp/htdocs/htdocs2/ssl/server.crt"
SSLCertificateKeyFile "C:/xampp/htdocs/htdocs2/ssl/server.key"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "C:/xampp/apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
#CustomLog "logs/ssl_request.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
# Per-Server Logging:
# The home of a custom SSL log file. Use this when you want a
# compact non-error SSL logfile on a virtual host basis.
#CustomLog "C:/xampp/apache/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

Edit This Lines With Your Info :

For Site Number 1 :

DocumentRoot "C:/xampp/htdocs"
ServerName www.website001.com:443
ServerAdmin admin@website001.com
SSLCertificateFile "C:/xampp/htdocs/ssl/server.crt"
SSLCertificateKeyFile "C:/xampp/htdocs/ssl/server.key"

For Site Number 2 :

DocumentRoot "C:/xampp/htdocs/htdocs2"
ServerName www.website002.com:443
ServerAdmin admin@website002.com
SSLCertificateFile "C:/xampp/htdocs/htdocs2/ssl/server.crt"
SSLCertificateKeyFile "C:/xampp/htdocs/htdocs2/ssl/server.key"

Save All

GO TO YOUR httpd-vhosts.conf and remove all and past this :( edit with your infos )
<VirtualHost *:80>
ServerAdmin website001.com
DocumentRoot "C:/xampp/htdocs/"
ServerName website001.com
ServerAlias www.website001.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin website002.com
DocumentRoot "C:/xampp/htdocs/htdocs2"
ServerName website002.com
ServerAlias www.website002.com
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs/"
ServerName website001.com
SSLEngine on
SSLCertificateFile "C:/xampp/htdocs/ssl/server.crt"
SSLCertificateKeyFile "C:/xampp/htdocs/ssl/server.key"
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs/htdocs2"
ServerName website002.com
SSLEngine on
SSLCertificateFile "C:/xampp/htdocs/htdocs2/ssl/server.crt"
SSLCertificateKeyFile "C:/xampp/htdocs/htdocs2/ssl/server.key"
<Directory "C:/xampp/htdocs/htdocs2/">
Require all granted
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>
</VirtualHost>

Save and Enjoy XAMPP Apache with multiple SSL hosts issue fixed

Previous
Next Post »