DEV Community

Cover image for How to Install SSL Certificate on XAMPP
Hilmi Hidayat
Hilmi Hidayat

Posted on • Updated on • Originally published at codelapan.com

How to Install SSL Certificate on XAMPP

Install XAMPP SSL - In some cases, a developer requires the presence of an SSL certificate on his local server to build a system or program that does require an SSL certificate or the HTTPS protocol. How to install SSL or HTTPS on localhost XAMPP? Following are the steps;

  1. Open your terminal How to Install SSL Certificate on XAMPP
  2. Type makecert as shown above. Install SSL Certificate on XAMPP
  3. Enter the PEM pass phrase or enter the password. Enter a password that is easy to remember because in the next step we are asked to enter a verification password. Install Https on XAMPP
  4. Verify the password or type the password again as in step 3. step by step Install Https on XAMPP
  5. Type as shown above. If there is a command other than the picture above, you can just ENTER. step by step Install SSL Certificate on XAMPP
  6. Enter the password again as was done in numbers 3 and 4.

  7. Configure the file by going to C:\xampp\apache\conf\extra

  8. Open the httpd-xampp.conf file

  9. Add SSLRequireSSL to , and . So the httpd-xampp.conf file will look like the image below. If so, don't forget to SAVE.
    Alt Text

  10. Open C:\xampp\apache\conf\extra

  11. Open the file httpd-ssl.conf

  12. Find the DocumentRoot text. Then make changes as shown below
    Alt Text

In DocumentRoot, adjust the location of your project and in ServerName change it to your liking. The purpose of the code above, when I enter the url www.geolocation.test it will display data from the DocumentRoot or our project.

  1. If so, SAVE. Then restart Apache.

DONE

If our project uses the laravel framework, we usually need to include "/public" in the URL like https://geolocation.test/public. We can remove public URL in laravel by::

  1. Move the .htaccess and index.php files to the root folder.

  2. Open the index.php file

find code

require __DIR__.'/../vendor/autoload.php';
Enter fullscreen mode Exit fullscreen mode

change into

require __DIR__.'/vendor/autoload.php';
Enter fullscreen mode Exit fullscreen mode

And, find code

$app = require_once __DIR__.'/../bootstrap/app.php';
Enter fullscreen mode Exit fullscreen mode

change into

$app = require_once __DIR__.'/bootstrap/app.php';
Enter fullscreen mode Exit fullscreen mode
  1. Save.

Now if I open it with the url https://geolocation.test it will display the default laravel display as shown below.
remove public URL in laravel

Thank's for your attention and don't forget to visit Codelapan.com, to get articles about web programming, web design, and others.

Top comments (0)