Run this file and enter the following information which will appear in your certificate. Within the \xampp\apache\ folder is a batch file called makecert.bat. If you would rather use your domain server, there are separate instructions below.Ĭreate a private key and certificate signing request This section assumes that you are going to use an external Certification Authority. Using an external Certification Authority This guide has been written for XAMPP 1.7.2. Note that while it the instructions are written for ADAM’s purposes, that they will give you a general outline for getting HTTPS to work over XAMPP. > open file "C:/xampp/apache/conf/extra/httpd-ssl.Notes: This page seems to be getting quite a few hits on this site. SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key" SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt" Apache show me the "C:/xampp/htdocs/index.php" at place of my "C:/xampp/htdocs/myApplication/public"ĭocumentRoot "C:/xampp/htdocs/myApplication/public"ĬustomLog "logs/myApplication-access.log" common > no need to restart anything just refresh the page in browser > add this line : "127.0.0.1 myVirtualHost" and save > edit "hosts" file in "C:\Windows\System32\drivers\etc" Note that chrome will indicate that the URL is Note Secure. SSLCertificateKeyFile "conf/ssl.key/server.key" SSLCertificateFile "conf/ssl.crt/server.crt" ServerAlias ErrorLog "logs/"ĬustomLog "logs/" common ServerAdmin "C:/xampp/htdocs/awesomesite/" Step 3: I didn't do as I didn't need/want the force redirects. No need to move them, but you will need to tell your nf file where they are (Step 4).ĮrrorDocument 403 /error/XAMPP_ key will be stored in C:\xampp\apache\conf\ssl.crt and C:\xampp\apache\conf\ssl.key folders respectively. Just putting down notes below that might help: SSLCertificateKeyFile : Same as SSLCertificateFile.Īfter all, if you configure everything correctly, it will show you result like this : SSLCertificateFile : Just copy, don’t modified it because in step create certificate, XAMPP will auto put your certificate in appropriate folder. VirtualHost *:443 : This is port to run SSLĭocumentRoot : Point to your project folder So, let’s go to file at address : E\xampp\apache\conf\extra\nfĬreate new virtual config as following sample : It’s time to config a virtual host to make a better URL to access our project. Step 4 : Config Virtual host to test site Now paste all this text to the config file at address E:\xampp\apache\conf\extra\nf(That is rewrite URL, if not, you can't access your site via SSL): LoadModule rewrite_module modules/mod_rewrite.so #LoadModule rewrite_module modules/mod_rewrite.so To do this, edit E:\xampp\apache\conf\nf and get rid of the comment (# character) in this line : This helps keep small the number of places in the config files where the server name is written (making your config files more maintainable).įirst, we need to make sure that mod_rewrite is enabled. To accomplish the redirection, we will use mod_rewrite so that we don’t have to use the server name in this part of the config file. If you don’t do this, and you used SSLRequireSSL, you will only be able to access these pages by typing This is fine and probably a little bit more secure, but is not so user friendly. This is more user friendly and allows you to still use http when you type in the address (and automatically switch to and encryption). This next optional step is to redirect “http” requests to “https” requests for the pages we want to secure. Step 3: Config mod_rewrite to generate SSL url Open this and add line that I talked above in all list folders below :Īnother config file that also need directive SSLRequireSSL located in e:\xampp\webdav. First, we will force ssl when access folders by add this directive “SSLRequireSSL” in this config file ( e:\xampp\apache\conf\extra\nf) Now this is time for you to config Apache to access folders with “https” instead of “http”. Step 2 : Config Apache to access https instead of http For example in localhost, I will use a Virtual host URL (I will configure it later) All you need is only typing all information that ‘s very easy, except one information “Common Name”, at this you must be typed exactly your URL website. In this, find
0 Comments
Leave a Reply. |