Last Updated: February 25, 2016
· pstadler
Me japan

Running Pow and Apache

Pow is a tool for mapping your web apps and their ports to a .dev domain locally. This guide shows how to setup Pow to run alongside Apache.

# Setup user home (http://localhost/~USERNAME/)
echo "<Directory \"/Users/$USER/Sites/\">
  Options Indexes MultiViews FollowSymLinks
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>" | sudo tee /private/etc/apache2/users/$USER.conf

# Setup http://apache.dev
echo "Listen 8080
NameVirtualHost *:8080

<VirtualHost *:8080>
  ServerName *.dev
  VirtualDocumentRoot \"/Users/$USER/Sites/\"
</VirtualHost>" | sudo tee /private/etc/apache2/other/pow.conf

# Install Pow if you haven't yet
curl get.pow.cx | sh

# Map port 8080 to apache.dev
echo 8080 > ~/.pow/apache

# Reload Apache
sudo apachectl graceful

Your Apache home directory is now accessible under http://apache.dev or the good old http://localhost/~USERNAME.

There's a gist with the most recent version.

You might want to follow me on Twitter or GitHub.