How to enable virtualhost in xampp>

Member

by adan , in category: Third Party Scripts , 6 months ago

How to enable virtualhost in xampp>

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by darion , 6 months ago

@adan 

To enable virtual hosts in XAMPP, follow these steps:

  1. Open the XAMPP control panel and click on the "Config" button for the Apache server.
  2. Select "httpd.conf" from the dropdown menu to open the Apache configuration file in a text editor.
  3. Search for the following line in the "httpd.conf" file: Virtual hosts
  4. Uncomment the line by removing the "#" symbol at the beginning of the line.
  5. Add the following code below the line you just uncommented: Virtual Hosts Include conf/extra/httpd-vhosts.conf
  6. Save the "httpd.conf" file and close the text editor.
  7. Open the "httpd-vhosts.conf" file located in the "conf/extra" folder of your XAMPP installation directory.
  8. Add a new virtual host configuration by inserting the following code:
  9. Replace "example" with the name of your virtual host and set the "DocumentRoot" to the directory of your website files.
  10. Save the "httpd-vhosts.conf" file and restart the Apache server in the XAMPP control panel.
  11. Open your web browser and navigate to the virtual host domain (e.g., http://example.test) to see your website.


That's it! You have successfully enabled virtual hosting in XAMPP. You can add more virtual hosts by following the same steps and creating additional configurations in the "httpd-vhosts.conf" file.