RedmineInstallOSXLionServer » History » Version 2

Version 1 (Art Kuo, 2012-06-02 01:03) → Version 2/16 (Art Kuo, 2012-06-02 02:49)

h1. Installing Redmine on Mac OS X 10.7 Lion Server

This is a quick summary of the necessary steps for a simple install of Redmine on Apple OS X Lion Server 10.7. It is meant only as a supplement, not a replacement, to the official install guide found here.

h2. Step by Step

Install Prerequisites

# Install Xcode/OS X Developer Tools
Either get XCode Install from the Mac App Store or register for a free account and download from:
An alternative is the latest version of Command Line Tools for XCode . This is a smaller download and contains all that is necessary for installation.
# Install OS X MySQL and associated Libraries
Download (select
latest 64-bit version, e.g. 5.5.25)
Run the installation package .pkg *.pkg* file. This will install into /usr/local/mysql/bin
Run the MySQLStartupItem.pkg file to use GUI to start automatically after startup of your server. (Of course, command line also works.)
Open the MySQL.prefPane and install for all users. This provides a GUI for starting and stopping. (Of couse, command line also works.)
Set the root password for your new installation of MySQL. One way is to use the "MySQLWorkbench": MySQLWorkbench: Or from the command line:
@mysqladmin *mysqladmin -u root password NEWPASSWORD@ (where NEWPASSWORD* where your password substitutes for NEWPASSWORD) NEWPASSWORD
Add MySQL to the path. path
In terminal:
@sudo *sudo touch /etc/paths.d/mysql@ /etc/paths.d/mysql* (creates a file in which you type the path)
@sudo *sudo nano /etc/paths.d/mysql@
In editor type @/usr/local/mysql/bin@ */usr/local/mysql/bin* then save and exit
Enter startup options to tell the MySQL client and daemon to connect to the local server.
In terminal:
@sudo *sudo nano /etc/my.cnf@ /etc/my.cnf*
In editor, add the following as appropriate:

socket = /tmp/mysql.sock
socket = /tmp/mysql.sock@ /tmp/mysql.sock
Install the MySQL binaries. Info about client libraries is available at , or to download directly use (or latest version) MySQL-54 for OSX 10.6.7)
@sudo tar -xvf ~/Downloads/MySQL-53.binaries.tar -C ~/Downloads@
or if you downloaded a .gz file,
@sudo tar
-xzvf ~/Downloads/MySQL-55.binaries.tar.gz ~/Downloads/MySQL-53.binaries.tar.gz -C ~/Downloads@
This will produce a root.tar archive, which must then also be extracted: extracted
@sudo tar -xzvf ~/Downloads/MySQL-55.binaries/MySQL-55.root.tar.gz ~/Downloads/MySQL-53.binaries/MySQL-53.root.tar.gz -C /@
If successful, tar should list the many files being placed in appropriate locations throughout
# Install Ruby Gems
@sudo gem install rails -v=2.3.5@
@sudo gem install rack -v=1.0.1@
@sudo gem install rake -v=0.8.3@
@sudo gem install fastthread@
@sudo env ARCHFLAGS="-arch x86_64" gem install mysql -v=2.8.1@
# If you are running desktop OS X (not
the system Server edition): See [[RedmineInstallOSX]]
# If you are running OS X *Server*: Install "Phusion Passenger":
This is a gem that handles Ruby on Rails applications and makes them accessible on the web server.
@sudo gem install passenger@
@sudo passenger-install-apache2-module@
The apache2 module installation will ask you to add several lines to the apache configuration file. For the standard Lion Server, the file is Some likely locations for this are /etc/apache2/httpd.conf . Typical lines to add are: (standard OS X Server installation) and /opt/local/apache2/conf/httpd.conf (MacPorts installation).
@LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-3.0.12/ext/apache2/
PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-3.0.12
PassengerRuby /System/Library/Frameworks/Ruby.framework/Version/1.8/usr/bin/ruby@
It may also be helpful to specify the user that runs passenger, with the line
@PassengerDefaultUser www@
# Build and install Install Passenger Pref Pane
This is a GUI interface for the Mac, to make it easy to add Ruby on Rails applications. Many of the binary prefPanes on the "web": are not compatible with 10.7, so it is necessary to "build": :
@cd ~/Downloads
git clone
cd passengerpane
(If you can't find xcodebuild, it may be in /usr/bin/xcodebuild)
Install the preference pane. Look in ~/Downloads/passengerpane/build/Release,
Download and double-click on Passenger.prefPane to install it.
An alternative is to download a pre-compiled build for 10.7, e.g. "SoftwhisperSL-PassengerPrefPane":

h2. h3. Install Redmine

# Checkout Redmine 2
@cd /Library/WebServer/Sites/@
If the Sites directory doesn't exist, create it (@sudo mkdir /Library/WebServer/Sites@)

@git clone @sudo svn checkout redmine@
# Configure Passenger
Open /Library/WebServer/Sites /Library/WebServer/Sites/redmine in Finder
Start Passenger preference pane in System Preferences
Drag redmine folder to Passenger (you may have to 'click to make changes')
Set "Address" to something like @redmine.local@ and click "Production"
Enter any aliases for

# If you are running desktop OS X (not
the website, such as Server edition): See [[RedmineInstallOSX]]
# If you are running OS X *Server*: Enable MySQL
Launch Server Admin, click + Sign, Add Service, Check MySQL box, click Save
Choose the MySQL service, click Set Root Password, click Start to start the service
Setup Database with redmine user and database
@mysql -u root -p@
(Enter the MySQL root password when prompted)
Now enter the following into MySQL, substituting a password of your choice for MYPASSWORD:
<pre> create database redmine character set utf8;

create user 'redmine'@'localhost' identified by 'MYPASSWORD'; 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost';@ 'redmine'@'localhost';</pre>
# Configure Redmine
@cd /Library/WebServer/Sites/redmine /Library/WebServer/Sites/redmine@
sudo @sudo mkdir tmp public/plugin_assets
sudo chown -R www:www tmp public/plugin_assets log files
chmod -R 755 files log tmp public/plugin_assets public/plugin_assets@
sudo @sudo cp config/database.yml.example config/database.yml@
Edit database.yml, e.g. ie.:
@production: <pre>

adapter: mysql
database: redmine
host: localhost
username: redmine
password: MYPASSWORD
socket: /tmp/mysql.sock@
If necessary, do the same for configuration.yml, for example to set up email SMTP. </pre>
# Install appropriate gems
Optional: It helps to have imagemagick, which can be installed with @brew install imagemagick@ if you use "Mac Homebrew":
@sudo gem install bundler
Make sure you are in the redmine directory @cd /Library/WebServer/Sites/redmine@:
sudo bundle install --without development test@
(If you don't have imagemagick, also append @rmagick@ to the above line)
Establish Defaults
@sudo rake generate_secret_code generate_session_store@ (may require gems i18n and updated rails)
sudo @sudo RAILS_ENV=production rake db:migrate db:migrate@
sudo RAILS_ENV=production @RAILS_ENV=production rake redmine:load_default_data@
When prompted, enter the appropriate language (e.g. @en@ for English) and press enter (If rails cannot access log file, do this: @sudo chmod 0666 log/production.log@)

h2. Configure Apache to serve up Redmine

You may wish to try
h3. Try out using webrick first, but you can move straight to apache.

# Go to, select Run the Web service, and add a new website. For example domain name @redmine.local@, and store site files in @/Library/WebServer/Sites/redmine/public@
# Restart the
ruby web server with @ruby script/server webrick -e production@
@sudo apachectl restart@
Or, in, turn the web service off and then on.
# Go to the Passenger prefPane a web browser and restart your redmine app view @http://localhost:3000@
The site should now be visible, e.g. at redmine.local
To serve outside of local, instructions
There may be found "here":
For example, to serve as a subdomain from your main server, do
some errors. An error regarding undefined "csrf_meta_tag" can be dealt with by deleting the following. First, link corresponding line in app/views/layouts/base.rhtml (perhaps line 8, but use the redmine directory into the directory where Server stores files in, e.g.
@ln -s /Library/WebServer/Sites/redmine/public /Library/Server/Web/Data/Sites/Default/redmine@
edit the appropriate .conf file in /etc/apache2/sites, and under VirtualHost add @RailsBaseURI /redmine@
error message to point at the same location be sure of proper line).

h2. Notes

For automated installs, check out [[How to install Redmine in Linux Windows and OS X using BitNami Redmine Stack]]
The following references were helpful for compiling this howto:
[[RedmineInstallOSXServer]] for Snow Leopard Server
This same procedure also works for Redmine 1.4. Installation for 1.4+ is made vastly easier by the gem bundler, which ensures the appropriate gem versions are maintained.