Xampp default port is 80 and 443 if you have many project and want to setup project with difference port in xampp called “Virtual Hosts”. This is how to Setup With Multiple Ports or virtual host in xampp.

Setting up XAMPP with multiple ports allows you to run multiple web applications or websites on a single server. XAMPP is a popular development environment that bundles Apache, MySQL, PHP, and other tools. Here’s a step-by-step guide on how to set up XAMPP with multiple ports:

 

1. Download and Install XAMPP: If you haven’t already, download and install XAMPP from the official website (https://www.apachefriends.org/index.html).

2. Launch XAMPP Control Panel: After installation, open the XAMPP Control Panel. On Windows, you can do this by searching for “XAMPP Control Panel” in the Start menu.

3. Configure Xampp Setup With Multiple Ports: By default, Apache runs on port 80. To run it on multiple ports, you need to configure Apache setup with multiple ports you want to use.

  1. In the XAMPP Control Panel, click on the “Config” button for Apache.
  2. Select “httpd.conf” from the dropdown menu. This will open the Apache configuration (“C:\xampp\apache\conf\httpd.conf”) file in your default text editor.
  3. In the configuration file, search for the line that says Listen 80 (this is the default port). To add more ports, you can copy this line and change the port number. For example:

    d. Save the configuration file and close the text editor.

4. Configure Virtual Hosts (Optional): If you want to set up multiple websites with different domain names or subdomains, you can configure virtual hosts.

  1. In the XAMPP Control Panel, click on the “Config” button for Apache again.
  2. Select “httpd-vhosts.conf” from the dropdown menu. This will open the virtual host configuration file in your default text editor.
  3. Add virtual host configurations for each port you’ve defined in the previous step. For example:

    Make sure to replace the paths and domain names with your own.

  4. Save the virtual host configuration file and close the text editor.

5. Edit Hosts File (Windows Only): On Windows, you’ll need to edit the hosts file to map domain names to IP addresses.

  1. Open Notepad as an administrator.
  2. Open the hosts file located at C:\Windows\System32\drivers\etc\hosts.
  3. Add entries for your domain names and map them to 127.0.0.1. For example:

  4. Save the hosts file.

6. Restart Xampp: In the XAMPP Control Panel, stop and then start the Apache server to apply the changes.

7. Access Your Websites: You can now access your websites by entering the domain names or IP addresses with the corresponding ports in your web browser. For example:

  1. http://localhost:85
  2. http://localhost:86
  3. http://localhost:87
  4. http://localhost:88

That’s it! You’ve set up XAMPP with multiple ports, allowing you to run multiple web applications or websites on your local server for development and testing.

Xampp Server Setup With Multiple Ports

Leave a Comment