MAMP Apache httpd.conf configuration with ProxyPass and ProxyPassReverse

As a quick note to self, I used this Apache httpd.conf configuration in MAMP on my MacBook Pro when developing my “Focus” web application in 2014:

<VirtualHost 127.0.0.1>
    ServerName focus
    ProxyPass /server http://localhost:8080
    ProxyPassReverse /server http://localhost:8080
    DocumentRoot /Applications/MAMP/htdocs/focus
    <Directory /Applications/MAMP/htdocs/focus>
        DirectoryIndex index.php index.html
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

When I came back to this in 2015 I stared at that configuration for a little while, wondering why I used ProxyPass and ProxyPassReverse settings, and then remembered that Focus was written with Sencha, and it used a Play Framework backend, and Sencha (generally speaking) needs to communicate with a server on the same domain as its website. By default, MAMP runs on port 8888, and I had the Play server running on port 8080.

FWIW, I also had this entry in my /etc/hosts file:

127.0.0.1    focus localhost

So that’s what those settings are about.