Project

General

Profile

RedmineInstallOSXMavericksServer » History » Version 33

Khedron Wilk, 2015-11-21 14:31
Tweaked to reflect the currently latest version of MySQL (5.7.9) and OS X (10.11.2).

1 33 Khedron Wilk
h1. Installing Redmine on OS X 10.9 Mavericks / 10.10 Yosemite / 10.11 El Capitan - Server and Client
2 2 Roland Laussat
3 33 Khedron Wilk
This is a quick summary of the necessary steps for a simple install of Redmine on Apple OS X Server and client, versions 10.9 - 10.11. This is slightly different from the install for [[RedmineInstallOSXServer|Snow Leopard Server]]. This is meant only as a supplement, not a replacement, to the official install guide found [[RedmineInstall|here]]. This summary contains instructions for MySQL only, for PostgreSQL or SQLite please see related part of the official install guide.
4 2 Roland Laussat
5
h2. Install Prerequisites 
6
7 33 Khedron Wilk
*Xcode and MySQL Server*
8 2 Roland Laussat
9 32 Khedron Wilk
First, install the developer command line-tools via Terminal:
10 14 Khedron Wilk
<pre>xcode-select --install</pre>
11 1 Roland Laussat
12 33 Khedron Wilk
Then install MySQL Community Server - get it from http://dev.mysql.com/downloads/mysql. Get the latest 64-bit DMG archive matching your version of OS X.
13 32 Khedron Wilk
This will also install a nifty little preference pane to start and stop the MySQL server. Make sure the Mysql-server is started before you proceed and that it is started after each machine restart.
14 1 Roland Laussat
15 17 Khedron Wilk
To make database administration easier you should include the database binaries in your path:
16 18 Khedron Wilk
<pre>export PATH=/usr/local/mysql/bin:$PATH</pre> (To make your life easier in the long run you may want to include this command in your ~/.bash_profile file.)
17 17 Khedron Wilk
18 33 Khedron Wilk
If the installer doesn't set a root password during the installation (later versions will display a random preset password the end of the installation), you've got to set it with mysqladmin:
19 2 Roland Laussat
<pre>mysqladmin -u root password "newpwd"</pre>
20 17 Khedron Wilk
Next, login to mysql. 
21 2 Roland Laussat
<pre>mysql -u root -p</pre>
22 17 Khedron Wilk
Create the database, the database user and set privileges:
23
<pre><code class="sql">CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci;
24
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
25
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';</code></pre>
26 9 Roland Laussat
27 17 Khedron Wilk
28 33 Khedron Wilk
_The following is not needed in mysql 5.7.9 OS X 10.10 and later. Actually, it is not even possible to do this symbolic link in OS X 10.10 and later with default system security. It is left here in case you have an earlier version:_ The Redmine installer expects the MySQL client library in a different place, so you need to create a symbolic link to the original location:
29 1 Roland Laussat
<pre>sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib  /usr/lib/libmysqlclient.18.dylib</pre>
30
31
*Redmine Prerequisites*
32
33
Redmine is built on Ruby which comes with Xcode, but some gems are missing:
34
<pre>sudo gem install rails bundler passenger</pre>
35
Next, use passenger to build the apache2-passenger module:
36
<pre>sudo passenger-install-apache2-module</pre>
37 33 Khedron Wilk
This will in the end output few lines of configuration code that you'll have to add to your Apache configuration (see below). Here follows an example, be aware that exact content may change with newer versions of related software:
38
<pre><code class="xml">LoadModule passenger_module /Library/Ruby/Gems/2.0.0/gems/passenger-5.0.21/buildout/apache2/mod_passenger.so
39 17 Khedron Wilk
<IfModule mod_passenger.c>
40 33 Khedron Wilk
	PassengerRoot /Library/Ruby/Gems/2.0.0/gems/passenger-5.0.21
41 17 Khedron Wilk
	PassengerDefaultRuby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
42
</IfModule></code></pre>
43 20 Khedron Wilk
In OS X Mavericks it's necessary to put this code in one of two files. Either in the default standard https.conf-file or in a separate file that is automatically included.
44
Alternative A - main config file:
45 1 Roland Laussat
Server:<pre>/Library/Server/Web/Config/apache2/httpd_server_app.conf</pre>
46 19 Khedron Wilk
Client:<pre>/etc/apache2/httpd.conf</pre>
47 20 Khedron Wilk
Alternative B - separate include file (create as needed):
48 1 Roland Laussat
Server:<pre>/Library/Server/Web/Config/apache2/other/passenger.conf</pre>
49
Client:<pre>/etc/apache2/other/passenger.conf</pre>
50 19 Khedron Wilk
51
52 17 Khedron Wilk
Finally, OS X Mavericks has a problem to install the rmagick gem which is optional for a successful installation of Redmine, but if you want to display images and charts it's necessary.
53 1 Roland Laussat
Get the following packages:
54 2 Roland Laussat
ImageMagick - http://cactuslab.com/imagemagick/ (Note there are two versions, one with free type which requires XQuartz to be installed - the basic version is sufficient.)
55
Pgkconfig - http://macpkg.sourceforge.net
56 33 Khedron Wilk
rmagick - http://rubygems.org/gems/rmagick (sometimes the download during installation fails, it's easier to have it stored locally). See note below about workable version!
57 1 Roland Laussat
58 33 Khedron Wilk
_Please be aware that rmagick version 2.13.4 and later does not build clean (at least not on OS X 10.10 and later). You may have to use the version before, 2.13.3, that one seems to compile and install fine._
59
60 1 Roland Laussat
Install ImageMagick and Pkgconfig, both should be installed in the /opt directory by default.
61
Because neither ImageMagick or Pkgconfig seems to add the path to the executable during the installation, you have to export the path variable:
62
<pre>export PATH=/opt/ImageMagick/bin:/opt/pkgconfig/bin:$PATH</pre>
63
64 33 Khedron Wilk
The following command should install the rmagick gem without errors (check the exact version number). If installation fails please check the paths to MagickCore.pc and MagickWand.h. 
65 27 Khedron Wilk
<pre>sudo C_INCLUDE_PATH=/opt/ImageMagick/include/ImageMagick-6/ PKG_CONFIG_PATH=/opt/ImageMagick/lib/pkgconfig/ gem install --local ~/Downloads/rmagick-2.13.3.gem</pre>
66 9 Roland Laussat
(Assuming rmagick has been downloaded to your Downloads directory)
67
68
h2. Install Redmine
69 3 Roland Laussat
70 21 Khedron Wilk
Get the latest stable build of Redmine and move the redmine directory to your web server root folder. The web server root folder is different on Server and client:
71
Server:<pre>/Library/Server/Web/Data/Sites/Default/</pre> 
72
Client:<pre>/Library/WebServer/Documents</pre> 
73 3 Roland Laussat
74 1 Roland Laussat
*Configure Redmine*
75
76 21 Khedron Wilk
In the Terminal, change current directory to the new redmine foder in your web root and excute the following commands to setup the folder structure:
77
<pre>
78 17 Khedron Wilk
sudo mkdir public/plugin_assets
79
sudo chown -R _www:_www tmp public/plugin_assets log files
80
sudo chmod -R 755 files log tmp public/plugin_assets
81
sudo cp config/database.yml.example config/database.yml</pre>
82 23 Daniel Miller
Edit database.yml, e.g., for MySql:
83 17 Khedron Wilk
<pre><code class="yaml">production:
84
  adapter: mysql2
85 3 Roland Laussat
  database: redmine
86 1 Roland Laussat
  host: localhost
87
  username: redmine
88 23 Daniel Miller
  password: put_redmine's_password_here</code></pre>
89 25 Daniel Miller
E.g., for PostgreSQL (as detailed at http://www.uponmyshoulder.com/blog/2011/cant-find-the-postgresql-client-library-libpq), an additional package needs to be installed in a nondefault way to forestall the install failures that will occur for PostgreSQL during “bundle install” far below:
90 24 Daniel Miller
<pre>sudo env ARCHFLAGS="-arch x86_64" gem install pg -v '0.17.1'</pre>
91 23 Daniel Miller
then for PostgreSQL, edit database.yml:
92
<pre><code class="yaml">production:
93
  adapter: postgresql
94
  database: redmine
95
  host: localhost
96
  username: redmine
97
  password: put_redmine's_password_here
98 1 Roland Laussat
  encoding: utf8</code></pre>
99
100
*Run Bundler*
101
102 31 Khedron Wilk
If you were forced to install an earlier version of rmagick (like 2.13.3) you will need to force the Bundler to use that version or the installation will fail. You can avoid this by edit the file "Gemfile". Look for the row that says gem "rmagick", ">= 2.0.0" and change it to gem "rmagick", "2.13.3". Save the file and then run the bundle install:
103 30 Khedron Wilk
<pre>bundle install --without development test</pre>
104 9 Roland Laussat
Assuming the installation finished without errors you can generate the secret token:
105 31 Khedron Wilk
<pre>rake generate_secret_token</pre>
106 2 Roland Laussat
Next steps:
107 31 Khedron Wilk
<pre>RAILS_ENV=production rake db:migrate</pre>
108
<pre>RAILS_ENV=production rake redmine:load_default_data</pre>You will be asked to choose language. Do so.
109 2 Roland Laussat
110 17 Khedron Wilk
If you want to do a quick test and take Redmine for a ride your can now do so:
111 33 Khedron Wilk
<pre>sudo ruby bin/rails server webrick -e production</pre>
112 17 Khedron Wilk
This will make your redmine available att http://localhost:3000
113
114
115 2 Roland Laussat
Last but not least you need to point Apache to the public folder inside the red mine directory to serve Redmine as a website.
116
Please make sure you tick _Allow overrides using .htaccess file_ in the advanced settings of your website configuration.
117 17 Khedron Wilk
118 2 Roland Laussat
119
For further information please see
120 1 Roland Laussat
[[RedmineInstallOSXServer|HowTo Install Redmine on Mac OS X Server]] 10.6 Snow Leopard
121
and
122
[[RedmineInstallOSXLionServer|HowTo Install Redmine on Mac OS X Lion Server]]
123
in case some details are missing here.
124 22 Marek Weisskopf
Here is some step by step advice how to do quick install and upgrade on 10.8 and 10.9 Mac OS X Server with bitnami package http://www.macweb.cz/aktualizujeme-redmine-na-novou-verzi-2-5-x/