論盡蛋
心で書く

Blog


My Apache + Pow.cx setup

I use Mac OS X, which have Apache2 installed by default. On the other hand, Pow.cx is great for running Rails apps locally (and with the new .xip.io for other computers to access).

So this is a post for myself, to jot down notes on how to set these up.

Basically just follow this wiki.

After following the above wiki (Running Pow with Apache), all things should be ready now.

To create a rails app

Given ~/Projects/rails-app.

When you create a symbolic link in the ~/.pow directory.

#!bash
cd ~/.pow
ln -s ~/Projects/rails-app

Then you should be able to visit the rails app through http://rails-app.dev.

Renaming ~/.pow/rails-app could change the domain name.

To create a php app

Given ~/Projects/php-app

When you do these two things:

  1. edit /etc/hosts to add a host (e.g. 127.0.0.1 php-app.local)
  2. edit /private/etc/apache2/extra/httpd-vhosts.conf to add your virtual host (or the conf file you use to add virtual hosts)

    DocumentRoot "/Users/PeterWong/Projects/php-app" ServerName php-app.local Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews AllowOverride All Order allow,deny Allow from all

Then you should be able to access the site through http://php-app.local.