LabstaffWeb Macintosh Resources

Table of Contents

VPN to campus

Follow the directions at

Apache via macOS Server

The Macintosh Server App is an inexpensive and very useful front end for Apache (and other services), especially for anyone who wants to create a website and test it locally before publishing. However, some of the more subtle capabilities of Apache are masked by this front-end. Here is some more info regarding administering a web server with the Macintosh Server app.

Where are the .conf files for Server configured sites?


How to set Apache to parse .html files with server side includes

Open the .conf file associated with your site in a text editor. Add the following within the block:
AddOutputFilter Includes shtml html htm php ssi
Any changes to a site's configuration through the Server app will undo this change in the conf file.

Setup Postgresql

Installing Postgreql

If you have the macOS Server software, do not use its internal version of Postgresql.

Using Macports to install Postgresql 9.4 (change substring 94 to match the version if you want something other than version 9.4).
sudo port selfupdate
sudo port install postgresql94
sudo port install postgresql94-server

Initializing psql

Assuming Postgresql version 9.4, the binaries are located /opt/local/lib/postgresql94/bin/

  1. Create data and log directories for Postgresql. Using your own account profile space makes it easy with filesystem permissions to create auto backup scripts using rsync.
    mkdir ~/psql/data
    mkdir ~/psql/logs
  2. Start Macintosh Automator.
  3. Choose to create an application.
  4. On left, under "Library", choose Utilities -> Run Shell Script.
  5. On right, choose "/bin/bash" for shell and "to stdin" to pass input. The script should be as follows:
    /opt/local/lib/postgresql94/bin/pg_ctl -D /Users/{user account}/psql/data -l /Users/{user account}/psql/logs/postgresql.log -o "-k /tmp/" start
  6. Export to save an .app of this script.
  7. Add the created .app as a login item in your account profile (System Preferences -> Users & Groups) so that the script will be automatically run when you login. This way, Postgresql is up and running as soon as you login.
  8. Create the database hive.
    /opt/local/lib/postgresql94/bin/initdb -D /Users/{user account}/psql/data
  9. Start Postgresql with the script command mentioned in step #4. This can be done on the command line.

Postgresql extension for PHP: and

PHP included with macOS does not have the requisite extension to communicate with Postgresql.
  1. On Yosemite (10.10) or later, turn off System Integrity Protection.
    • Reboot into the system recovery (CMD-R during bootup).
    • In a terminal type:
      csrutil disable
    • Don't forget to re-enable System Integrity Protection after the pgsql and pdo_pgsql extensions are fully installed.
  2. Install autoconf using Macports:
    sudo port selfupdate
    sudo port install autoconf
  3. Determine what major version of PHP that your Mac has. e.g. macOS Sierra (10.12.1) ships with PHP 5.6.25.
    php --version
  4. Create a temporary working directory and download PHP with Curl. Make sure PHP version matches what is on your Mac.
    curl -O
  5. Extract source:
    tar -xzvf php-5.6.25.tar.gz
  6. and must be compiled separately.
    • For
      cd php-5.6.25/ext/pgsql/
    • for
      cd php-5.6.25/ext/pdo_pgsql/
  7. Configure source (assuming postgresql version 9.4)
    • For
      ./configure --with-pgsql=/opt/local/lib/postgresql94/bin/
    • for
      ./configure --with-pdo-pgsql=/opt/local/lib/postgresql94/bin/
  8. Compile ( and
    make install
  9. Activate the extensions in php.ini
    • php.ini is located in /etc.
      cd /etc
      sudo nano php.ini
    • Add the following lines to the ini file (they can go right at the top)
  10. Restart apache
    apachectl restart
    • If you have macOS, you may instead need to go into, disable, and then re-enable the web server.
  11. Don't forget to re-enable Systems Integrity Protection as referenced in step #1.

Discontinued Security Updates OS X / macOS

Apple has discontinued issuing security updates for all versions of OS X 10.10 Yosemite and older. Anyone still using any of these older operating systems remains exposed to unpatched digital threats, and should consider updating to a newer macOS. macOS 10.13 Sierra is free from the Macintosh App Store. Check here for minimum system requirements.

64-bit EFI

The latest macOS requires a 64-bit EFI. To check if your EFI is EFI32 or EFI64, run this command in the terminal:

ioreg -l -p IODeviceTree | grep firmware-abi

Should you have a (very) old Macintosh that reports EFI32, the latest operating system you can run is OS X 10.7 Lion, and therefore you should consider buying a new Macintosh computer as soon as possible. El Capitan, Sierra, and High Sierra must have a 64-bit EFI.

X11 / Matlab by Remote

If you want to use remote applications with X forwarding (e.g. ssh -Y user@server), such as Matlab, you need X11 software installed.
See below for link.

Useful Software

Software Location Notes
X11 Required for X forwarding via SSH (i.e. Matlab)
VirtualBox Free to use Virtual Machine software
The Gimp Image editing software
Audacity Audio editing software
Latex, Mactex Latex for Mac
Libre Office Fork of Open Office that is well maintained
Text Wrangler, BBEdit Excellent light-weight text/code editor
The Unarchiver Extract files from compressed formats not natively supported by Mac, like RAR and 7z
Mac Ports Command line tool to retrieve/compile open source software (requires Xcode*)
0xED Hex editor

*Xcode is available from the Macintosh app store.

-- JoeyArmstrong - 28 Apr 2009
-- PeterBailie - 17 Jan 2018
Topic revision: r19 - 17 Jan 2018, PeterBailie
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback