Starting with v0.4.0 of Pow, you can proxy virtual hosts to different ports. We can take advantage of this such that my-php-app.dev can point to Apache while Pow handles your Rack/Rails apps normally.
We need to get Apache listening on a port other than 80, as Pow uses port 80, and then tell Apache how to map our domain names (my-php-app.dev) to the folder that holds that app.
Create a new file /etc/apache2/other/pow.conf and give it the following contents:
Listen 8080 NameVirtualHost *:8080 <VirtualHost *:8080> ServerName *.dev VirtualDocumentRoot "/Users/your-user-name/Sites/%-2" </VirtualHost>
Note: You may need to use sudo to save the file.
First we’re telling Apache to listen on port 8080 too. Pow uses port 80, so we have to pick another port that Apache can listen on and have Pow proxy to.
Next, we tell Apache we want to use name-based virtual hosts for our new port.
Finally we tell Apache how to turn a domain name into the folder that stores our application. If you store your applications in a different folder, just change the path given in the VirtualDocumentRoot directive to match your setup.
Now you can restart Apache with:
sudo apachectl graceful
Apache is now ready to serve requests proxied by Pow.
To add your application to Pow, rather than creating a symbolic link like you would for a Rack/Rails app, we need to create a file with the port that Pow needs to proxy to for Apache.
If the folder that holds your application is named my-php-app, just create a file in ~/.pow named my-php-app and the port number we chose above (8080) as the contents:
echo 8080 > ~/.pow/my-php-app
You should now be able to open http://my-php-app.dev in your browser and see your application!
Repeat the Pow steps for each application you would like to have Pow support.