====== Setting up Akelos on OS X Snow Leopard ======
===== Introduction =====
When I recently tried getting started with Akelos, I realised that the required setup for Mac OS X Snow Leopard (10.6) is neither described nor does it match the available tutorials or "Getting Started"s. When I finally got to the point that I had Akelos running on my Mac with MAMP, I decided to do a quick Setup Guide to make it easier for others having the same issues.
===== Prerequisites =====
- Mac OS 10.6 Snow Leopard is installed
- [[http://www.mamp.info/en/index.html|MAMP (Mac Apache, MySQL, PHP)]] is installed to your /Applications/ folder
- A Terminal window is open (/Applications/Utilities/Terminal.app)
- If you have upgraded to Snow Leopard (not fresh installation) you may want to install [[http://dev.mysql.com/downloads/mysql/5.4.html#macosx-dmg|the latest version of MySQL]]
===== Getting Started =====
==== Prepare MAMP ====
=== Apache Web-Server ===
I'd recommend to have the following setup for your MAMP Web-Root:
/Applications
/MAMP
/htdocs
/public_html
/link_to_public_folders
/akelos_framework_folder
/any_akelos_project_folder
This means, you do the follwing steps:
- Open the folder /MAMP/htdocs/
- Create a new folder named "public_html"
- Start the MAMP application /MAMP/MAMP.app
- Go to "Settings > Apache"
- Change the path to "/Applications/MAMP/htdocs/public_html" & confirm with OK
=== MySQL Database-Server ===
You need to make a connection (called "symlink") between the MySQL-Socket of MAMP and the one delivered by Mac OS X.
* Switch to the Terminal window
* Execute the following commands (requires your administrator password):
sudo mkdir /var/mysql
sudo chown _mysql /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
Please check the connection to MAMP's MySQL Server with the following Terminal commands:
/Applications/MAMP/Library/bin/mysql -uroot -proot -P 8889
If everything is fine, it should say "Welcome to the MySQL monitor." in your Terminal window.
**Now launch MAMP.app and start both, the Web- and Database-Server.**
==== Grab Akelos ====
You need a local copy of the Akelos Framework now. Get it either via [[http://www.akelos.org/wiki/setupprojectwithsubversion|Subversion Checkout]] or simply [[http://www.akelos.org/download|download the latest stable release]].
Put the "akelos" folder to following directory:
/Applications/MAMP/htdocs/
===== Setup your Project =====
Unfortunately it looks like you need to setup a new project more or less only via Terminal - the Akelos Web Configuration Wizard seems to be broken due to some unknown reason. But don't mind, I'll describe step by step how this works. In my example, I will stick to the [[http://www.akelos.org/docs/tutorials/booklink|Booklink Tutorial]].
* Switch to the Terminal window
* Execute the following commands:
cd /Applications/MAMP/htdocs/akelos
./script/setup -d /Applications/MAMP/htdocs/booklink -p /Applications/MAMP/htdocs/public_html/booklink
A new project folder named "booklink" has now be created under /MAMP/htdocs/ (this is the main project folder) and a link to it's public folder (for visitors of your project website) has been put into /MAMP/htdocs/public_html/.
Now you can configure your project and let Akelos create the databases (you can confirm the default values with [RETURN]):
* Switch to the Terminal window ([[#hint|☞ hint]])
cd /Applications/MAMP/htdocs/booklink
./script/configure -i
Database name: [RETURN]
Database type: [RETURN]
Database user: root
Database password: root
Development database name: [RETURN]
Production database name: [RETURN]
Testing database name: [RETURN]
Application Locales: [RETURN]
==== Hint ====
-> In case you get an error "**Could not connect to the database**" in the Terminal, you should use a MySQL-GUI-Application (such as YourSQL orSequel Pro) to create the databases manually and proceed the configuration by pointing your Webbrowser to [[http://localhost:8888/booklink/]].
Alternatively, open app > config > database.yml and set the host from localhost to 127.0.0.1
//
//
===== =====
The databases have now been setup, the configuration was successful if you see the message "Your application has been configured correctly".
Your project website should be available on [[http://localhost:8888/booklink/]] (Akelos "Welcome aboard" screen).
===== Closing Words =====
Your Project is properly setup and ready that you can get your hands on it. Follow the next instructions from the [[http://www.akelos.org/docs/tutorials/booklink|Booklink Tutorial]] starting at chapter "The booklink database structure".
===== References used =====
* MAMP Forum Thread "Using terminal to connect to MAMP mysql"
* Akelos Forum Thread "Stuck on install - "Could not load inflector rules file" and "Could not connect to the database""
* Akelos Forum Thread "Problem with MySQL database"
* Stefan Fischerländer’s Blog: [[http://tinyurl.com/MacOSXMAMPMySQLTrouble|Mac OS X: Trouble with MAMP MySQL]]
* hasematzel.de: [[http://hasematzel.de/blog/2009/09/10/snow-leopard-und-apache-php-und-mysql/|Enable Apache, PHP and MySQL on Snow Leopard (German)]]
* This might help if your [[http://mackeeper.zeobit.com/macbook-pro-running-slow | macbook running slow]]