Seabon
Seabon

Reputation: 241

MAMP Virtualhost on mac not working

I tried to make a virtualhost with MAMP for the first time. I rode several tutorials but what I did is not working...

Let me explain :

First I added in /etc/hosts a new line 127.0.0.1 domain.dev

In virtualhost.conf, I added

<VirtualHost 127.0.0.1:80>
        DocumentRoot    "/Users/cyrille/Documents/pro/sites/domain/domain/web"
        ServerName      domain.dev
        ServerAlias     domain.dev

        <Directory "/Users/cyrille/Documents/pro/sites/domain/domain/web">
            Options FollowSymLinks Indexes
            AllowOverride All
            Order deny,allow
            allow from All
        </Directory>
</VirtualHost>

There is an index.php in the 'web' directory.

In httpd-vhosts.conf, I added

<VirtualHost *:80>
 DocumentRoot /Applications/MAMP/htdocs
 ServerName localhost
</VirtualHost>

<VirtualHost *:80>
 DocumentRoot /Users/cyrille/Documents/pro/sites/domain/domain/web
 ServerName domain.dev
</VirtualHost>

Some people said I have to remove the "#" next to Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf in httpd.conf

when I go to domain.dev I have the message 'Website is unavailable'. When I ping domain.dev I have this response :

PING domain.dev (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.047 ms...

I already have restarted MAMP.

If somebody has an idea why it does not works...

Thank you !

Upvotes: 1

Views: 2698

Answers (1)

Seabon
Seabon

Reputation: 241

Ok,

I found the solution, In MAMP, I had to click on "set web & MYSQL to 80 & 3306". When you download MAMP, apache port is on 8888...

Upvotes: 4

Related Questions