mardi 26 février 2019

Virtual hosts not working on MAMP5 & Mac OS

I went through many threads and tutorials and can't find an answer to my problem. I use Mac OS Mojave and MAMP 5.2. It seems like everything is configured correctly but my virtual hosts are not working.

httpd.conf

# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

https-vhostsconf

NameVirtualHost *:8888

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:8888>
    ServerName dev.local.com
    DocumentRoot /Applications/MAMP/htdocs
    ServerAlias dev.local.com
</VirtualHost>

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

<VirtualHost *:8888>
    DocumentRoot   "/path/www/public/"
    ServerName     example.dev
    ServerAlias    www.example.dev 

    <Directory "/path/www/public/">
        Options       All
        AllowOverride All
        Require       all granted
    </Directory>
</VirtualHost>

<VirtualHost *:8888>
    DocumentRoot   "/path2/public/"
    ServerName     example2.dev
    ServerAlias    www.example2.dev 

    <Directory "/path2/public/">
        Options       All
        AllowOverride All
        Require       all granted
    </Directory>
</VirtualHost>

And finally /etc/hosts

127.0.0.1       localhost
127.0.0.1       example.dev
127.0.0.1       example2.dev

MAMP is configured to use port 8888 for Apache and 8889 for MySQL. The error I get when accessing example.dev:8888 or the other address is a 404 not found. What am I missing?




Aucun commentaire:

Enregistrer un commentaire