Archive for the 'general' Category

Mac OS X Localhost Subdomains with Apache’s Virtual Hosts and NetInfo Manager

Monday, February 5th, 2007

This is how to create subdomains for testing purposes on localhost. I found a few articles on how do this on Windows (using host files), but nothing for mac. Say for instance you wanted to change your user’s site root to http://username.localhost instead of http://localhost/~username

  • Backup /private/etc/httpd/httpd.conf in case something goes wrong. Just duplicate it with a date-stamp or other memorable name.
  • Open /private/etc/httpd/httpd.conf with your favorite text editor.
  • Try seraching for NameVirtualHost, you should find it around line number 1063. You’ll want to uncomment that line.
    NameVirtualHost *:80
  • There are a few instructions on the following lines. You’ll need something like this in following those instructions.
    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot /Library/WebServer/Documents
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerName username.localhost
        DocumentRoot /Users/username/Sites
    </VirtualHost>

Now you’ll have to edit your configuration in NetInfo Manager so the computer knows where to find your subdomain.

NetInfo Manager Screenshot with username.localhost Subdomain

  • Open NetInfo Manager: Applications > Utilities > NetInfo Manager.
  • Click the lock in the lower left corner, you’ll be prompted for an Administrator password.
  • Click on / and then machines. You should see something there named localhost.
  • Click on localhost, then the duplicate icon on the upper left.
  • You should then have something called localhost copy. Go ahead and click on localhost copy.
  • Double click the name field and give it the name of your subdomain in the Apache config file, i.e. username.localhost. Leave everything else as the default.
  • Go ahead and save your changes.
  • You should be able to browse to your sub-domain and see your personal website.

Screenshot of Ownership and Permissions

If you get a 403 Forbidden error, you probably need to set the permissions on your sites directory so the world has read access. Get Info on your sites directory, open Ownership and Permissions at the bottom, Others should be Read Only, Apply to enclosed items… and you should be good to go.

Mac OS X Apache and PHP

Monday, February 5th, 2007

There are programs around that make turning on Apache/PHP/MySQL very easy. But what if you want to use Mac OS X’s built in Personal Web Sharing.

  • Backup /private/etc/httpd/httpd.conf in case something goes wrong. Just duplicate it with a date-stamp or other memorable name.
  • Open /private/etc/httpd/httpd.conf with your favorite text editor.
  • Around line 240, uncomment the line that loads PHP module: LoadModule php4_module
  • Around 284, uncomment the link that adds the PHP module: AddModule mod_php4.c
  • Restart Apache by restarting System Preferences > Sharing > Services Tab > Personal Web Sharing.
  • Try a test document with phpinfo(). My version of Tiger had PHP Version 4.4.4 and the Configuration File (php.ini) Path at /etc.

phpinfo() running on localhost

Free TV

Wednesday, July 12th, 2006

RewardsVenue just sent a check for $1800. Just enough for a new HDTV.

Check from RewardsVenue for a new HDTV

Test for Art (New Title)

Sunday, April 17th, 2005

This is just a test to see if I can update posts without duplication on my art site.

This is now the edited version, so this post is different than the first.

Failed Maid of Honor Toast

Sunday, March 6th, 2005

As you may know my sister’s wedding was this past Saturday. As the maid of honor, I was to give a toast. So here it is, and if you knew Isaac’s family you’d know why it was rejected:

I was worried about standing up here giving this toast, so I did some research to help start the creative juices flowing. However, the research wasn’t very helpful. All I learned was to never say that I slept with the bride. And, so, I haven’t.

Communisim

Thursday, October 21st, 2004

Top story tonight on KTLA’s 10 o’clock news:

Fidel Castro Trips

My First Blog

Wednesday, June 9th, 2004

I’ve had way to much time recently. I left my old job last friday and don’t start my new one — yeah for new graphic design, ideal job — until this friday.

So with all this time, I started fixing up the clarinet website because there were some techincal gliches with the photo gallery. Then Brian suggested that I put blog up for news and events type stuff. I started doing that for the clarinet site and realized I really didn’t want to put in all that effort — and then getting my roommate to use it on top of everything. What I really wanted was to have a bolg on my site.

After trying out a few different types of blogs at opensource cms, I ended up going with WordPress. WordPress looked nice as default and setup in 5 seconds flat. But, as always, I couldn’t use the default look, which promted me to redo my whole site with a more stream-lined CSS — I think my pages are about half the lines they used to be because of all those embedded tables. So, here it is!