I’m using xampp v7.2.29.
But I can’t setup a Virtual Host(vHost).
Here is my code:
apacheconfextrahttpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot "E:xampphtdocs"
<Directory "E:xampphtdocs">
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName local.demoapp.com
DocumentRoot "E:xampphtdocsDemoApp"
<Directory "E:xampphtdocsDemoApp">
Require all granted
</Directory>
</VirtualHost>
C:WindowsSystem32driversetchost
127.0.0.1 locl.demoapp.com
I’m using the above code but getting this error.
2
Answers
You made a typo error on your host file.
Since you used
as your server name, your host file should be
you can also follow this.
Input the configuration bellow : make sure to change your file location to DocumentRoot, Directory and change ServerName.
After that restart your Apache Server by Xampp service.
Find your own pc IP address.
Then find and open host file. If you are windown user edit
If you are OSX / Mc user then open terminal and and copy paste the following code below ‘sudo nano /private/etc/hosts’
at host file write your ip address and server name like bellow
After that restart your apache server and browse the server name on browser. You will find the project there.
You can follow this tutorial for better understanding