MAMP Virtual Host Configuration Problem

Keywords: LAMP/MAMP/WAMP - Installers - How to - Application configuration

Description:
Having trouble with the MAMP on OSX virtual hosts configuration. I just want to use it as a local development server for the sites I work on. I modify my computer’s hosts file to point the actual domain names at the local IP, but with the MAMP installation, I can’t seem to get the virtual hosts to work.

I’ve read a few posts on this forum and tried various solutions, but no luck.

Here is the virtual host I’m trying to set up as a test:

<VirtualHost *:8080>
    DocumentRoot "/PATH_TO_DIR/MAMP_7424/apache2/htdocs/test"
    ServerName mymamp.com
    ServerAlias www.mymamp.com
</VirtualHost>

I’ve tried putting this in:
apache2/extra/httpd-vhosts.conf
apache2/bitnami/bitnami-apps-vhosts.conf
and
apache2/bitnami/bitnami.conf

I’ve also tried <VirtualHost _default_:8080>

In my hosts file I’ve tried:

localhost  mymamp.com
localhost:8080  mymamp.com
127.0.0.1  mymamp.com
127.0.0.1:8080  mymamp.com

The closest I’ve gotten was using 127.0.0.1 mymamp.com which gives ERR_CONNECTION_REFUSED in the browser instead of DNS_PROBE_FINISHED_NXDOMAIN

the ‘test’ directory in htdocs contains a simple index.html file.

What am I doing wrong?

Well I tried changing the port the MAMP stack uses to 80 and got it to work.

I would still like to know how to do it using alternate ports, though.

Hi @cvc1968,

You need to configure it as follows

 127.0.0.1 mymamp.com

And then connect through mymamp.com:8080.

Can you try that?

Regards,
Michiel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.