LabstaffWeb Macintosh Resources

Table of Contents

VPN to campus

Follow the directions at https://dotcio.rpi.edu/services/network-remote-access/vpn-connection-and-installation/configuring-vpn-mac-os-x-106-snow

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?

/Library/Server/Web/Config/apache2/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: pgsql.so and pdo_pgsql.so

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
      reboot
    • 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 http://us.php.net/distributions/php-5.6.25.tar.gz
  5. Extract source:
    tar -xzvf php-5.6.25.tar.gz
  6. pgsql.so and pdo_pgsql.so must be compiled separately.
    • For pgsql.so:
      cd php-5.6.25/ext/pgsql/
    • for pdo_pgsql.so:
      cd php-5.6.25/ext/pdo_pgsql/
  7. Configure source (assuming postgresql version 9.4)
    phpize
    • For pgsql.so:
      ./configure --with-pgsql=/opt/local/lib/postgresql94/bin/
    • for pdo_pgsql.so:
      ./configure --with-pdo-pgsql=/opt/local/lib/postgresql94/bin/
  8. Compile (pgsql.so and pdo_pgsql.so)
    make
    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)
      extension=pgsql.so
      extension=pdo_pgsql.so
  10. Restart apache
    apachectl restart
    • If you have macOS Server.app, you may instead need to go into Server.app, 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 traditionally supports security updates for the three most recent versions of macOS. As of this writing, the latest macOS is 10.14 Mojave, with 10.13 High Sierra and 10.12 Sierra also still supported. Anyone using an older version of macOS remains exposed to unpatched digital threats, and should consider updating to the latest macOS. macOS is available on the Macintosh app store.

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. The latest macOS requires 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 https://www.xquartz.org/ Required for X forwarding via SSH (i.e. Matlab)
VirtualBox https://www.virtualbox.org/wiki/Downloads Free to use Virtual Machine software
The Gimp http://gimp.lisanet.de/Website/Download.html Image editing software
Audacity http://audacity.sourceforge.net/ Audio editing software
Latex, Mactex http://www.tug.org/mactex Latex for Mac
Libre Office https://www.libreoffice.org/download/libreoffice-fresh Fork of Open Office that is well maintained
Atom https://atom.io/ Highly customizable text/code editor maintained by Github
Github Desktop https://desktop.github.com/ Native desktop UI for Github
BBEdit http://www.barebones.com/products/textwrangler/download.html Light-weight text/code editor
The Unarchiver https://theunarchiver.com/ Extract files from compressed formats not natively supported by Mac, like RAR and 7z
Mac Ports http://www.macports.org Command line tool to retrieve/compile open source software (requires Xcode*)
0xED http://www.suavetech.com/0xed/ Hex editor

*Xcode is available from the Macintosh app store.


-- JoeyArmstrong - 28 Apr 2009
-- PeterBailie - 23 Sept 2019
Topic revision: r20 - 23 Sep 2019, 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