#LORIS Mac Install Guide
This is an a guide how to get a LORIS instance Running on your Mac computer. It has been tested for Mac OS X 10.9.
Before continuing to the subsequent sections ensure that the following tools are installed. Sudo permission is required. This section covers installation and recommended versions of:
- Mac OS X (tested for Mavericks - OS X 10.9)
- Apache2
- PHP
- PEAR
- Perl
- MySQL
Apache2 should be preinstalled on your Mac. To verify, type the following command into a terminal window:
sudo apachectl start
Navigate to http://localhost. Your browser should display the message "It works!"
PHP should be preinstalled on your Mac. To verify, type the following command into a terminal:
php -v
Ensure that your php version is 5 or higher (5.x.x). Note Loris is tested for php 5.3+
Check if you currently have PEAR installed:
pear version
If installed proceed to section 1.3.3 else continue.
To install PEAR do the following:
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
To determine the location of the php.ini file use the following:
php --ini
The location of the php.ini
will be listed under the Loaded Configuration File:
. If listed (none)
use the following to initiate the file
sudo cp /etc/php.ini.default /etc/php.ini
This command will initiate the file to the /etc
directory
For PEAR to work with LORIS it has to be included in the include_path
in the php.ini
. To do so do the following:
-
Locate where PEAR installs .php files
pear config-get php_dir
-
Check to see if the path from aboves output is included in the
include_path
php -c $pathToPhpIni -r 'echo get_include_path()."\n";'
$pathToPhpIni ⇾ path to php.ini
refer to section 1.3.3
-
If not add the path to the
include_path
sudo vi $pathToPhpIni
$pathToPhpIni ⇾ path to
php.ini
refer to section 1.3.3Locate the line containing
include_path
. Ensure that you are adding the path to the UNIX instance of theinclude_path
and that the line does not start with;
.Add the path to the end of the string using a
:
to seperate the path from the previous path.
Perl should be preinstalled on your Mac. To ensure type the following command into terminal
perl -v
Check if you currently have MySQL installed:
mysql
If already installed continue to section 1.6 else continue
Download the latest DMG Archive for you current Mac setup (either 32-bit or 64-bit) from the following link [dev.mysql.com/downloads/mysql] (dev.mysql.com/downloads/mysql) and install the necessary files.
Open System Preferences on your machine and select the MySQL icon. Start the MySQL server if it hasn’t already been started. Check Automatically Start MySQL Server on Startup if you dont want to have to repeat this step everytime you resart your computer.
Access MySQL with the following
mysql -u root
If the command is not found use the following
sudo sh -c 'echo /usr/local/mysql/bin > /etc/paths.d/mysql'
Then restart terminal or open a new tab or window and start this step over.
Once in the mysql command prompt, use the following command to reset the password
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$newpwd');
$newpwd ⇾ you new desired password for the root user
###1.6.1 Obtaining Smarty 3
Go to http://www.smarty.net/download and download the latest stable release of Smarty 3.x.x
###1.6.2 Setting up Smarty 3
Create the following directories if they do not already exist:
sudo mkdir /usr/local/lib/php
sudo mkdir /usr/local/lib/php/Smarty
Next, unzip the downloaded zip file and locate the libs directory. Move it into the Smarty directory (created above), and rename it to smarty3 in the process. Use the following:
sudo mv /path/to/Smarty-3.x.x/libs/ /usr/local/lib/php/Smarty/smarty3
After you have moved the directory ensure to add the path /usr/local/lib/php/Smarty
to the include_path
in the php.ini file (see section 1.3.4 part 3).
#2. Installing LORIS Code Base
This section goes over how to obtain the LORIS code base and setup the database on your local machine.
##2.1 Obtaining the LORIS code
Download the latest release from the releases page and
extract it to ~/Sites/$projectname
$projectname ⇾ “loris” or one-word project name
##2.2 Installing LORIS
Run installer script to install core code, libraries, and MySQL schema (see Loris Installation Schematic). The script will prompt for information, including usernames and folders which it will create automatically.
cd ~/Sites/$projectname/tools
./install.sh
The install script was created for LINUX OS so its apache2 setup steps won’t work. Section 3 describes how to apache2 server.
Open the /etc/apache2/httpd.conf
in a text editor and locate the line containing
LoadModule php5_module libexec/apache2/libphp5.so
Ensure that the line is uncommented (remove the #
at the beginning of the line)
Do the following to allow for use of MySql with Apache2, unless link already exists
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
In order for apache to know where to find the LORIS code base you have to first set up your user config file. To do so, open your user conf file using the following:
sudo vi $username.conf
$username ⇾ your username for the computer
Once in the text editor, ensure that the file looks similar to the following:
<Directory "/Users/$username/Sites/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Restart your apache server:
sudo apachectl restart
You can now access you LORIS sandbox using the url http://localhost/~$username/loris/htdocs
To access your sandbox on another device, replace localhost
with your IP address for your machine.
The following section is a more advanced setting for you local apache server. This section is not necessary, but enables http://localhost.loris
as an url shortcut, and creates LORIS-specific apache logs for easy troubleshooting (similar to /var/log/apache2/loris-err.log
).
Open the /etc/apache2/httpd.conf
in a text editor and locate the line containing Include /private/etc/apache2/extra/httpd-vhosts.conf
Ensure that the line is uncommented (remove the #
at the beginning of the line)
Open the /etc/apache2/extra/httpd-vhosts.conf
in the text editor and add the following:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "/Users/$username/Sites/loris/htdocs/"
ServerName localhost.loris
ErrorLog "/private/var/log/apache2/loris.com-error_log"
CustomLog "/private/var/log/apache2/loris.com-access_log" common
<Directory "/Users/$username/Sites/loris/htdocs/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
php_value include_path .:/usr/share/php:$pathToPear:/Users/$username/Sites/loris/project/libraries:/Users/$username/Sites/loris/php/libraries:/usr/local/lib/php/Smarty
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ServerSignature Off
#SSLEngine Off # change to On to enable, after updating cert paths below
#SSLCertificateFile /etc/apache2/ssl/loris-cert.pem
#SSLCertificateKeyFile /etc/apache2/ssl/loris-key.pem
#SSLCACertificateFile /etc/apache2/ssl/CA-cacert.pem
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents/
</VirtualHost>
- $username ⇾ your username for the computer
- $pathToPear ⇾ path where PEAR installs .php files (see section 1.3.4 part 1)