configuring virtual host redirects to iis homepage

I have XAMPP running on Windows 10. I am trying to setup a Virtual Host so that when I use "myapp.dev" as a domain I get directly to my public folder of laravel project.
Laravel is located at C:/xampp/htdocs/myapp/public.
By using http://localhost:8000/myapp/public/ i can access laravel index.php
So far i have tried the following:
http v-host.conf file
#this is the default address of XAMPP    
<VirtualHost *:8000>
   DocumentRoot "C:/XAMPP/htdocs/"
   ServerName localhost
</VirtualHost>


<VirtualHost *:8000>
    DocumentRoot "C:/xampp/htdocs/myapp/public"
    ServerName myapp.test
    SetEnv NS_ENV variable_value
</VirtualHost>

and in C:\Windows\System32\drivers\etc\host file

127.0.0.1 localhost
127.0.0.1:8000 myapp.test

and after restarting apache and typing myapp.test leads to iis homepage instead of index.php in public folder.
arsalan jibranAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin MillerCTOCommented:
First, I am not sure you can add a port number to the host file and have this work.

You can do this...
127.0.0.1 myapp.test
127.0.0.1  myotherapp.test
127.0.0.1  yetanotherapp.test

Your vhost file, needs to be edited to something like this...


<VirtualHost myapp.test:8000>
    DocumentRoot "C:/xampp/htdocs/myapp/public"
    ServerName myapp.test
    SetEnv NS_ENV variable_value
</VirtualHost>
<VirtualHost myotherapp.test:8000>
    DocumentRoot "C:/xampp/htdocs/myotherapp/public"
    ServerName myotherapp.test
    SetEnv NS_ENV variable_value
</VirtualHost>

I think IIS is picking up on port 80, and that should be another clue for you.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin MillerCTOCommented:
Can I close this question ?
0
arsalan jibranAuthor Commented:
yes you can close this question.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Laravel

From novice to tech pro — start learning today.