I’ve recently been helping a friend with some web site stuff. Nothing too complex, just some php that results in some html and css.
Continually ftp’ing the files back and forth to my ISP hosted account was becoming labour intensive, so I figured I would just use the apache web server built into OS X on my Mac Mini.
Some notes:
The main apache config file is located at:
/etc/apache2/httpd.conf
Each user has a personal apache config file that specifies the location of their personal web folder location. This file is located at:
/etc/apache2/users/<username>.conf
Each user/logon gets a folder called ‘Sites’ in their home location (so /Users/<user>/Sites/). This folder is the root folder of your personal web folder name space.
When you access the site, the url to use is:
http://servername/~username
If you don’t like the tilde character (~) being part of the url, you can get around it by editing the users personal apache config file. Add the following to the top of the file:
/etc/apache/user/<username>.conf
Restart apache (either from the Preferences panel, or with ‘apachectl restart’ and you should be good to go.
So my logon on my Mac Mini is Scott. The file I need to edit is:
/etc/apache2/users/Scott.conf
And I need to add the line:
Alias /Scott “/Users/Scott/Sites/”
I also add:
Alias /scott “/Users/Scott/Sites/”
So I don’t have to worry about case sensitivity. So now instead of using:
http://mymacmini/~Scott
you should be able to use:
http://mymacmini/scott

