Installing Elgg on a MacBook Pro
From InstallationWiki
[edit] Overview
After reading the main Elgg installation wiki page (Installing_Elgg), I still ran into a lot of little, quirky configuration issues while trying to install Elgg on my MacBook Pro. They may have been because I'm used to Redhat Linux and somewhat new to MacOS, but for whatever reason I kept track of what it took for me to get it to work, and I'm documenting it here in case someone else gets in a similar jam. Hope this helps! :)
[edit] How to install Elgg on a Macbook Pro with MacOS 10.5.6
- Open a terminal and make sure you have PHP5 installed on your Macbook pro:
sh-3.2# php --version PHP 5.2.6 (cli) (built: Jul 17 2008 23:04:49) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
- Make sure you have the apache rewrite module installed:
sh-3.2# /usr/sbin/httpd -t -D DUMP_MODULES 2>&1 | grep rewrite_module rewrite_module (shared)
- Turn AllowOverride on in /etc/apache2/httpd.conf:
<Directory "/Library/WebServer/Documents">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks MultiViews
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
- Restart apache:
/usr/sbin/httpd -k restart
Make sure that it really did restart. I.e check the pids before and after the restart with:
ps aux | grep httpd
If that doesn't work, shutdown it down gracefully, and it should restart automatically with new pids:
sh-3.2# /usr/sbin/httpd -k graceful-stop sh-3.2# ps aux | grep httpd _www 73651 0.0 0.0 2711356 692 ?? S 11:46AM 0:00.00 /usr/sbin/httpd -D FOREGROUND _www 73650 0.0 0.0 2711356 2080 ?? S 11:46AM 0:00.00 /usr/sbin/httpd -D FOREGROUND _www 73649 0.0 0.1 2711356 5168 ?? S 11:46AM 0:00.08 /usr/sbin/httpd -D FOREGROUND _www 73648 0.0 0.1 2711356 5240 ?? S 11:46AM 0:00.23 /usr/sbin/httpd -D FOREGROUND root 73647 0.0 0.2 2711356 8444 ?? Ss 11:46AM 0:00.18 /usr/sbin/httpd -D FOREGROUND root 73673 0.0 0.0 75492 456 s001 R+ 11:48AM 0:00.00 grep httpd
- Download and install MySQL
- Start MySQL, and make sure to specify the socket that Elgg is expecting mysql to use:
sh-3.2# sudo -u _mysql mysqld --socket=/var/mysql/mysql.sock & [1] 61130 sh-3.2# 090106 9:06:33 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql-5.0.67-osx10.5-x86_64/data/ is case insensitive 090106 9:06:34 InnoDB: Started; log sequence number 0 435701 090106 9:06:34 [Note] mysqld: ready for connections. Version: '5.0.67' socket: '/var/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
- Create an Elgg data directory:
mkdir /var/elgg_data chmod 777 !$
- Download and unpack Elgg into your web directory (/Library/WebServer/Documents/elgg1.2)
- Create an elgg user in your mysql database:
mysql --socket=/var/mysql/mysql.sock -uroot elgg -e "CREATE USER elgg IDENTIFIED BY 'elgg'"
mysql --socket=/var/mysql/mysql.sock -uroot elgg -e "SET PASSWORD FOR elgg = PASSWORD('password')"
mysql --socket=/var/mysql/mysql.sock -uroot mysql -e "GRANT ALL ON *.* TO elgg@localhost"
Don't use an empty password as Elgg is expecting a non-empty password.
- Create an elgg database:
mysql --socket=/var/mysql/mysql.sock -uroot -e "CREATE DATABASE elgg"
- Copy engine/settings.example.php to engine/setting.php and edit the db values to look like:
// Database username
$CONFIG->dbuser = 'elgg';
// Database password
$CONFIG->dbpass = 'password';
// Database name
$CONFIG->dbname = 'elgg';
// Database server
// (For most configurations, you can leave this as 'localhost')
$CONFIG->dbhost = 'localhost';
// Database table prefix
// If you're sharing a database with other applications, you will want to use this
// to differentiate Elgg's tables.
$CONFIG->dbprefix = 'elgg';
o Navigate a web browser to http://localhost/elgg1.2/index.php and follow the directions.
[edit] See also
Installing_Elgg - Main Elgg installation article
