Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

how to create virtual host on xampp or wamp in windows.

Let’s create a virtual host in windows… on xampp or wamp or ampps

Navigate to C:\Windows\System32\Drivers\etc for host file.

At first, you have to reset the permission to edit and save the host file. Here is the process

  • Right click on the ‘host’ file then select ‘Properties’
  • You will get a new window, click on the ‘Security’ tab
  • Select the User that you are logged in from ‘Group or User names’ box
  • Now hit the ‘Edit’ button and you will get another window
  • Select the ‘Users’ that you are already logged in
  • Allow ‘Full control’ to select all permissions
  • Now Apply and click ok
  • And now nobody stops you to save the host file 🙂

 

 

httpd.conf file loc: D:\xampp\apache\conf

uncomment “Include conf/extra/httpd-vhosts.conf” if it is commented.

httpd-vhosts.conf file location: D:\xampp\apache\conf\extra

Lastly, need to restart apache server

 

 

? How to Enable SSL in Xampp (Localhost)

Way one:

Configure your SSL in xampp/apache/conf/extra/httpd-vhost.conf like this:

 

<VirtualHost *:443>

DocumentRoot D:/xampp/htdocs/yourProject

ServerName yourProject.whatever

SSLEngine on

SSLCertificateFile “conf/ssl.crt/server.crt”

SSLCertificateKeyFile “conf/ssl.key/server.key”

</VirtualHost>

 

Way Two:

If you need SSL in more than one project, it’s better to change it in the httpd-ssl.conf

Easy steps:

  1. D:\xampp\apache\conf\extra\httpd-ssl.conf”
  2. Search ‘DocumentRoot’ text.
  3. Change DocumentRoot

DocumentRoot “D:/xampp/htdocs” to

DocumentRoot “D:/xampp/htdocs/project name”.

 

And lastly, restart the apache server.

4 thoughts on “how to create virtual host on xampp or wamp in windows.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Wordpress Social Share Plugin powered by Ultimatelysocial