teepusink
teepusink

Reputation: 28892

MAMP multiple VirtualHost

I'm trying to add a VirtualHost to my MAMP.
So here are the steps that I did.

  1. in /etc/hosts I add the following

    127.0.0.1 dev1.loc
    127.0.0.1 dev2.loc

  2. in httpd.conf I added

    < VirtualHost *:80 >
    DocumentRoot "path"
    ServerName dev1.loc
    < /VirtualHost >

    < VirtualHost *:80 >
    DocumentRoot "path"
    ServerName dev2.loc
    < /VirtualHost >

So that almost work but not all the way.
Meaning, dev1.loc does work, but dev2.loc is pointing me to dev1.loc.

Do I need to do something special?

Thanks,
Tee

Upvotes: 0

Views: 568

Answers (1)

teepusink
teepusink

Reputation: 28892

Ah got it resolved.
I also need to uncomment this line in httpd.conf

NameVirtualHost *

Thanks,
Tee

Upvotes: 1

Related Questions