Some Key Codes for Terminal.app

Some useful key codes for Terminal.app. The default behavior appears to be that the keys Page Up and Page Down will go up and down the Terminal.app buffer and not sent to the terminal program. This can be very annoying for interacting with programs like Emacs when it’s running in the terminal. The following are a few non-printing characters and their key bindings for use in the Terminal.app keyboard options. (From a post in the macosxhints.com forums)


Pause = 32
Macro = 3 # Break (Shift-Pause)
Home = 33[1~
Insert = 33[2~
Remove = 33[3~ # Delete
End = 33[4~
PageUp = 33[5~
PageDown = 33[6~

Apache and PHP on Mac OS X

Apache is automatically installed on OS X but is not enabled by default. To enable, go to System Preferences->Sharing and check the Web Sharing box.

By default, each of the users will have a website at /Users/username/Sites/ which can be accessed at http://localhost/~username/

A possible problem can come if this was an update to OS X 10.5 from a different version. If a “Forbidden 403” error shows up when going to a user homepage, it is missing probably a file in the users directory of the apache configurations (/etc/apache2/users/). Follow the directions at the Apple help site to fix.

Apache has PHP turned off by default, but can be enabled by editing the configuration file at /private/etc/apache2/httpd.conf and uncommenting the line: #LoadModule php5_module.

To get PHP working, need to make the php.ini file, this can be done easily by just moving the default file:
mv /private/etc/php.ini.default /private/etc/php.ini.

Further help on getting PHP working with Apache on OS X 10.5 can be found here.