I wiped my Old(ish) Macbook and upgraded to Snow Leopard this gave my Core Duo 1.8ghz 2g ram macbook a lease of new life. I needed to re-setup my local dev enviroment and noticed a few people where unsure how to setup vhosts with apache default install with OSX 10.6/10.5/10.4 so here it is step by step.
Edit the hosts file to add a local DNS entry.

Add the domain name you wish to use 127.0.0.1 is the loopback IP do not change this IP.

Create the folders and files for the local website. I chose to place the log files for apache in the site folder and the website content under a sub folder www.

Edit httpd.conf I used path finder here to show the locations.

You can also use VI or any text editor

On line 465 uncomment: Include /private/etc/apache2/extra/httpd-vhosts.conf and save the file.

Edit: /etc/apache2/extra/httpd-vhosts.conf

Add in the details of the new virtual host and save:
( I'm running Railo on Tomcat locally so I have so additional parameters )
I also set my logging levels to log as much as possible.
Notice the location of the logs files matched the access.log and error.log files created earlier

Run: apachectl -t
to confirm there are no syntax errors.
I choose to leave the example sites, they cause a warning but it wont stop apache.
Then restart apache: sudo apachectl restart

Create a test file in the new folder for the virtual host ( /Users/Paul/Sites/paulsDev/www )

Confirm the new virtual host works:

If you'd like to watch the logs in a terminal you can use tail:
tail -f /the/Path/to/the/log/file

BTW Dave made a great How-to on setting up Tomcat and Railo on OSX which you can view here.
Subscribe to:
Post Comments (Atom)
Categories-
- Actionscript (5)
- Adobe (8)
- AIR (3)
- Apple (2)
- BlackBerry (1)
- CFML (59)
- ColdFusion (84)
- ColdFusion 8 (12)
- ColdFusion 9 (28)
- Database (2)
- Flash (11)
- Flash 10 (6)
- FlashBuilder (4)
- Flex (31)
- Internet Explorer (1)
- iPhone (4)
- Java (8)
- jQuery (1)
- Linux (8)
- Microsoft (5)
- Open Blue Dragon (10)
- Open Source (11)
- Operating Systems (3)
- PHP (1)
- Railo (24)
- SQL (3)
- SVN (2)
- Twitter (2)
- VPS (1)
- Windows (5)

Blog Archive
-
►
2010
(38)
-
►
August
(9)
- ColdFusion and cfquerynew and date times - timesta...
- ColdFusion Lists, SQL IN and cfqueryparam
- iPhone and Flash - Sucess
- ColdFusion jrun and the JVM
- ColdFusion and CFReport
- jQuery or EXTjs
- iPhone 3Gs and Flash player
- Easy way to embed ColdFusion code into your blog
- Flex and the MATE framework in Melbourne
-
►
August
(9)
-
▼
2009
(89)
-
►
December
(17)
- ColdFusion 9 and the local scope continued
- Is this an issue with the local scope in ColdFusio...
- Are you using ColdFusion 9's ORM?
- Want more performance from a default Railo install...
- WizzyWig the comic and snow
- Linux Start and Stop scripts for Ventrilo - Ubuntu...
- ColdFusion Builder Beta 3 - Any one seen this?
- Streaming AMF channel with ColdFusion 9 and BlazeD...
- Forwarding or masking your domain with GoDaddy
- Cheap ColdFusion hosting
- Should I get an iPhone?
- Full Screen Flex
-
▼
September
(12)
- ColdFusion and CFML sites
- Do you close your ColdFusion tags
- Another new ColdFusion podcast
- ColdFusion 9s ORM and Flex with a simple demo
- Google App Engine Twitter OpenBD and Flex
- Google App Engine Flex OpenBD and ColdFusion
- How to add Virtual hosts in Snow Leopard OSX
- OpenBD cfcs the Datastore and an Enterprise Manage...
- OpenBD Google App Engine and cfc's
- ColdFusion on Google App Engine with OpenBD
- New(ish) ColdFusion - RIA Podcast
- Inline Java compilation in ColdFusion 9s VFS with ...
-
►
December
(17)
Reccomended:
- TweetTrail
- Load Cell
- MyTouch Cases
- View Prom Hairstyles
- Cell Phone Accessories
- business operating agreement
- learn how to recycle electronics



3 comments:
uhm, excuse me. Wow
THanks so much! I have been wrestling with this for a few days. Do your .htacces files work under this setup? I still can't get mine to engage eventhough I now have the virtual hosts in place. Thanks again
Good question. Locally I am not using mod_rewrite but you will need to add this block when defining the vhost:
%Directory /Users/Paul/Sites/paulsDev/www%
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
%/Directory%
*note I swapped % for <
Post a Comment