Skip to content

Instantly share code, notes, and snippets.

@pstadler
Last active November 16, 2016 19:39
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pstadler/5568440 to your computer and use it in GitHub Desktop.
Save pstadler/5568440 to your computer and use it in GitHub Desktop.
Running Pow and Apache

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment