Xampp Open Website

broken image


All Topics > Homepage and Web Design > Server and Hosting

XAMPP: XAMPP is an open source cross-platform web server developed by Apache friends. It is best for web developers who develop websites using PHP as it provides an easy way to install the necessary components required to run PHP based software like WordPress, Drupal, etc on Windows 10 locally. XAMPP is free and open-source software, backed-up by a sizable support community. It's also extremely lightweight, and all the elements required to set up a local web server are contained within a single extractable file. What's more, learning how to use XAMPP is relatively straightforward, as we'll discuss in the following XAMPP tutorial.

Tutorial by Stefan Trost | Last update on 2018-06-10 | Created on 2018-03-16

Website

In this tutorial, I would like to show you how to set up your XAMPP configuration in a way that you can access your local PHP projects via SSL and in the browser via an HTTPS URL. You can use that, for example, in the case that your online website is running over HTTPS and you want to use the same link structure also for testing.

In my tutorial about virtual domains, I had already explained the basics of how to define domains with XAMPP and Apache, which can then point to a local directory in the XAMPP installation. After this setup, all domains can only be accessed via HTTP. In order to allow also HTTPS, the following steps are necessary additionally.

Create Certificate

Open

First, we have to create our own SSL certificate. Luckily, XAMPP already has a little script ready for us that we can use and open like this:

  1. The script can be found in the Apache folder of the XAMPP installation, in a standard installation on Windows this is the path: C:xamppapache
  2. In this folder we find the file makecert.bat, with a double-click on the file we can start the script.

After starting the script, the command line opens, where we only need to follow the instructions. First we have to enter a password for our key, that should look like this.

Here we can enter any password of our desire and then repeat it. Further questions follow, such as country (Country Name) or company (Organization Name). Here we can basically enter what we want or type in a point if we want to leave the field blank. This information will be used later in our certificate. As a 'Common Name' we enter the name of our URL. Finally we have to repeat the password from the beginning again, then the certificate is created.

Xampp Website Templates

The whole procedure looks like this:

Now our certificate has been created and this step is done. The ready certificate was placed in the folders C:xamppapacheconfssl.crt and C:xamppapacheconfssl.key, provided we installed XAMPP in C:xampp.

Xampp open website download

Define VirtualHost

In the next step, we have to set up a new VirtualHost for each domain within the file C:xamppapacheconfextrahttpd-vhosts.conf similar to what we did in the first tutorial.

At this point, it's important to know that HTTP is running on port 80, but SSL is on port 443. In the following, we'll define the URL example.com, which can then be called with both http://www.example.com and https://www.example.com afterwards. The first block applies to all requests over port 80 and looks something like the blocks from the first tutorial. Under DocumentRoot we can specify the root directory.

The HTTPS requests are defined via the second block. The DocumentRoot directory, ServerName, and ServerAlias specifications are identical. In addition, we still need to provide information about our SSL certificate and key. This tells the server where to find the appropriate files. As you can see, we have defined the folders where our certificate has just been stored.

In the example here we have only defined one URL that should be reachable via HTTP and HTTPS. Each additional domain or URL must be defined in exactly the same way, we can write any number of blocks of this type among each other.

Restart Apache

For our changes to take effect, we must now restart Apache. For this, we open the XAMPP Control Panel and click on 'Stop' behind the module 'Apache' and then on 'Start', so that the server restarts with the new configuration.

Add Exceptions

Now we are done with our configuration. However, if we call our website via the browser, we may receive the error message 'This connection is not secure' with error code SEC_ERROR_UNKNOWN_ISSUER (depending on browser and browser settings). The Firefox browser provides the dissuasive text 'The owner of ... did not properly configure the site, Firefox did not connect to the site to protect your information from theft.' In short, we can not just visit our website.

The reason is that we have created the certificate on our own and Firefox only trusts certificates from official certification authorities. For our purposes that would of course be exaggerated, so we can confidently click on the button 'Add an exception ...'. In the dialogue that opens up, we should activate the option 'Permanently save this exception', otherwise we will be asked again with each call. Afterwards we can click on 'Confirm security exemption' and should now finally be able to see our website via the HTTPS URL.

Xampp Open Websites

About the Author

You can find Software by Stefan Trost on sttmedia.com. Do you need an individual software solution according to your needs? - sttmedia.com/contact
Show Profile

Related Topics

XAMPP: Call via HTTPS leads to Error 403 (Access Forbidden)

Question | 1 Answer

Create virtual domains for Apache/XAMPP

Tutorial | 0 Comments

Delphi: Add Path to Library or Unit for all Projects

Install

Xampp Open Website Free

Question | 1 Answer

Local Gravity for different Places and Planets

Info | 0 Comments

Why is the local gravity at the poles greater than at the equator?

Xampp Open Website Login

Question | 1 Answer

phpMyAdmin: Increase File Size Limit for Import

Xampp

In this tutorial, I would like to show you how to set up your XAMPP configuration in a way that you can access your local PHP projects via SSL and in the browser via an HTTPS URL. You can use that, for example, in the case that your online website is running over HTTPS and you want to use the same link structure also for testing.

In my tutorial about virtual domains, I had already explained the basics of how to define domains with XAMPP and Apache, which can then point to a local directory in the XAMPP installation. After this setup, all domains can only be accessed via HTTP. In order to allow also HTTPS, the following steps are necessary additionally.

Create Certificate

First, we have to create our own SSL certificate. Luckily, XAMPP already has a little script ready for us that we can use and open like this:

  1. The script can be found in the Apache folder of the XAMPP installation, in a standard installation on Windows this is the path: C:xamppapache
  2. In this folder we find the file makecert.bat, with a double-click on the file we can start the script.

After starting the script, the command line opens, where we only need to follow the instructions. First we have to enter a password for our key, that should look like this.

Here we can enter any password of our desire and then repeat it. Further questions follow, such as country (Country Name) or company (Organization Name). Here we can basically enter what we want or type in a point if we want to leave the field blank. This information will be used later in our certificate. As a 'Common Name' we enter the name of our URL. Finally we have to repeat the password from the beginning again, then the certificate is created.

Xampp Website Templates

The whole procedure looks like this:

Now our certificate has been created and this step is done. The ready certificate was placed in the folders C:xamppapacheconfssl.crt and C:xamppapacheconfssl.key, provided we installed XAMPP in C:xampp.

Define VirtualHost

In the next step, we have to set up a new VirtualHost for each domain within the file C:xamppapacheconfextrahttpd-vhosts.conf similar to what we did in the first tutorial.

At this point, it's important to know that HTTP is running on port 80, but SSL is on port 443. In the following, we'll define the URL example.com, which can then be called with both http://www.example.com and https://www.example.com afterwards. The first block applies to all requests over port 80 and looks something like the blocks from the first tutorial. Under DocumentRoot we can specify the root directory.

The HTTPS requests are defined via the second block. The DocumentRoot directory, ServerName, and ServerAlias specifications are identical. In addition, we still need to provide information about our SSL certificate and key. This tells the server where to find the appropriate files. As you can see, we have defined the folders where our certificate has just been stored.

In the example here we have only defined one URL that should be reachable via HTTP and HTTPS. Each additional domain or URL must be defined in exactly the same way, we can write any number of blocks of this type among each other.

Restart Apache

For our changes to take effect, we must now restart Apache. For this, we open the XAMPP Control Panel and click on 'Stop' behind the module 'Apache' and then on 'Start', so that the server restarts with the new configuration.

Add Exceptions

Now we are done with our configuration. However, if we call our website via the browser, we may receive the error message 'This connection is not secure' with error code SEC_ERROR_UNKNOWN_ISSUER (depending on browser and browser settings). The Firefox browser provides the dissuasive text 'The owner of ... did not properly configure the site, Firefox did not connect to the site to protect your information from theft.' In short, we can not just visit our website.

The reason is that we have created the certificate on our own and Firefox only trusts certificates from official certification authorities. For our purposes that would of course be exaggerated, so we can confidently click on the button 'Add an exception ...'. In the dialogue that opens up, we should activate the option 'Permanently save this exception', otherwise we will be asked again with each call. Afterwards we can click on 'Confirm security exemption' and should now finally be able to see our website via the HTTPS URL.

Xampp Open Websites

About the Author

You can find Software by Stefan Trost on sttmedia.com. Do you need an individual software solution according to your needs? - sttmedia.com/contact
Show Profile

Related Topics

XAMPP: Call via HTTPS leads to Error 403 (Access Forbidden)

Question | 1 Answer

Create virtual domains for Apache/XAMPP

Tutorial | 0 Comments

Delphi: Add Path to Library or Unit for all Projects

Xampp Open Website Free

Question | 1 Answer

Local Gravity for different Places and Planets

Info | 0 Comments

Why is the local gravity at the poles greater than at the equator?

Xampp Open Website Login

Question | 1 Answer

phpMyAdmin: Increase File Size Limit for Import

Xampp Open Website Login

Question | 1 Answer

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That's how it's done.





broken image