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;
- Open your terminal
- Type makecert as shown above.
- 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.
- Verify the password or type the password again as in step 3.
- Type as shown above. If there is a command other than the picture above, you can just ENTER.
Enter the password again as was done in numbers 3 and 4.
Configure the file by going to C:\xampp\apache\conf\extra
Open the httpd-xampp.conf file
Add SSLRequireSSL to , and . So the httpd-xampp.conf file will look like the image below. If so, don't forget to SAVE.
Open C:\xampp\apache\conf\extra
Open the file httpd-ssl.conf
Find the DocumentRoot text. Then make changes as shown below
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.
- 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::
Move the .htaccess and index.php files to the root folder.
Open the index.php file
find code
require __DIR__.'/../vendor/autoload.php';
change into
require __DIR__.'/vendor/autoload.php';
And, find code
$app = require_once __DIR__.'/../bootstrap/app.php';
change into
$app = require_once __DIR__.'/bootstrap/app.php';
- Save.
Now if I open it with the url https://geolocation.test it will display the default laravel display as shown below.
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)