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.
/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/
- 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
- Start Macintosh Automator.
- Choose to create an application.
- On left, under "Library", choose Utilities -> Run Shell Script.
- 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
- Export to save an .app of this script.
- 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.
- Create the database hive.
/opt/local/lib/postgresql94/bin/initdb -D /Users/{user account}/psql/data
- 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.
- 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.
- Install autoconf using Macports:
sudo port selfupdate
sudo port install autoconf
- 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
- 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
- Extract source:
tar -xzvf php-5.6.25.tar.gz
-
pgsql.so
and pdo_pgsql.so
must be compiled separately.
- Configure source (assuming postgresql version 9.4)
phpize
- Compile (
pgsql.so
and pdo_pgsql.so
) make
make install
- Activate the extensions in
php.ini
- 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.
- 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
*Xcode is available from the Macintosh app store.
--
JoeyArmstrong - 28 Apr 2009
--
PeterBailie - 23 Sept 2019