Project

General

Profile

RedmineInstallOSXMavericksServer » History » Revision 29

Revision 28 (Khedron Wilk, 2014-11-28 22:25) → Revision 29/35 (Khedron Wilk, 2014-12-12 19:34)

h1. Installing Redmine on OS X 10.9 Mavericks Server and Client 

 This is a quick summary of the necessary steps for a simple install of Redmine on Apple OS X Mavericks Server 10.9. This summary can also be applied on Mavericks Client. 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 please see related part of the official install guide. 

 h2. Install Prerequisites  

 *Xcode 5 and MySQL Server* 

 Get Xcode 5 from the Mac App Store or register for a free account and download from: https://developer.apple.com/downloads/. (It seems that strictly speaking the full Xcode installation is not needed to install the command-line tools but download and install ful Xcode anyway to be on the safe side.) 
 Next, install the command line-tools via Terminal: 
 <pre>xcode-select --install</pre> 

 Then install MySQL Community Server - get it from http://dev.mysql.com/downloads/mysql (get the Mac OS X 10.9 10.7 64-bit DMG archive). 
 This It will also install a nifty little preference pane to start and stop the MySQL server. 

 To make database administration easier you should include the database binaries in your path: 
 <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.) 

 Because the installer doesn't set a root password during the installation, you've got to set it with mysqladmin: 
 <pre>mysqladmin -u root password "newpwd"</pre> 
 Next, login to mysql.  
 <pre>mysql -u root -p</pre> 
 Create the database, the database user and set privileges: 
 <pre><code class="sql">CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci; 
 CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password'; 
 GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';</code></pre> 


 The Redmine installer expects the MySQL client library in a different place, so you need to create a symbolic link to the original location: 
 <pre>sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib    /usr/lib/libmysqlclient.18.dylib</pre> 

 *Redmine Prerequisites* 

 Redmine is built on Ruby which comes with Xcode, but some gems are missing: 
 <pre>sudo gem install rails bundler passenger</pre> 
 Next, use passenger to build the apache2-passenger module: 
 <pre>sudo passenger-install-apache2-module</pre> 
 This will in the end output few lines of configuration code that you'll have to add to your Apache configuration. Here follows an example, be aware that exact content may change with newer versions of related software: 
 <pre><code class="xml">LoadModule passenger_module /Library/Ruby/Gems/2.0.0/gems/passenger-4.0.53/buildout/apache2/mod_passenger.so 
 <IfModule mod_passenger.c> 
	 PassengerRoot /Library/Ruby/Gems/2.0.0/gems/passenger-4.0.53 
	 PassengerDefaultRuby /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 
 </IfModule></code></pre> 
 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. 
 Alternative A - main config file: 
 Server:<pre>/Library/Server/Web/Config/apache2/httpd_server_app.conf</pre> 
 Client:<pre>/etc/apache2/httpd.conf</pre> 
 Alternative B - separate include file (create as needed): 
 Server:<pre>/Library/Server/Web/Config/apache2/other/passenger.conf</pre> 
 Client:<pre>/etc/apache2/other/passenger.conf</pre> 


 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. 
 Get the following packages: 
 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.) 
 Pgkconfig - http://macpkg.sourceforge.net 
 rmagick - http://rubygems.org/gems/rmagick (sometimes the download during installation fails, it's easier to have it stored locally) 

 Install ImageMagick and Pkgconfig, both should be installed in the /opt directory by default. 
 Because neither ImageMagick or Pkgconfig seems to add the path to the executable during the installation, you have to export the path variable: 
 <pre>export PATH=/opt/ImageMagick/bin:/opt/pkgconfig/bin:$PATH</pre> 

 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. Please be aware that latest version at this time, 2.13.4, does not build clean (at least not on OS X 10.10 Yosemite). You may have to use the version before, 2.13.3, that one seems to compile and install fine. 
 <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> 
 (Assuming rmagick has been downloaded to your Downloads directory) 

 h2. Install Redmine 

 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: 
 Server:<pre>/Library/Server/Web/Data/Sites/Default/</pre>  
 Client:<pre>/Library/WebServer/Documents</pre>  

 *Configure Redmine* 

 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: 
 <pre> 
 sudo mkdir public/plugin_assets 
 sudo chown -R _www:_www tmp public/plugin_assets log files 
 sudo chmod -R 755 files log tmp public/plugin_assets 
 sudo cp config/database.yml.example config/database.yml</pre> 
 Edit database.yml, e.g., for MySql: 
 <pre><code class="yaml">production: 
   adapter: mysql2 
   database: redmine 
   host: localhost 
   username: redmine 
   password: put_redmine's_password_here</code></pre> 
 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: 
 <pre>sudo env ARCHFLAGS="-arch x86_64" gem install pg -v '0.17.1'</pre> 
 then for PostgreSQL, edit database.yml: 
 <pre><code class="yaml">production: 
   adapter: postgresql 
   database: redmine 
   host: localhost 
   username: redmine 
   password: put_redmine's_password_here 
   encoding: utf8</code></pre> 

 *Run Bundler* 

 <pre>sudo bundle install --without development test</pre> 
 Assuming the installation finished without errors you can generate the secret token: 
 <pre>sudo rake generate_secret_token</pre> 
 Next steps: 
 <pre>sudo RAILS_ENV=production rake db:migrate</pre> 
 <pre>sudo RAILS_ENV=production rake redmine:load_default_data</pre> 

 If you want to do a quick test and take Redmine for a ride your can now do so: 
 <pre>sudo ruby script/rails server webrick -e production</pre> 
 This will make your redmine available att http://localhost:3000 


 Last but not least you need to point Apache to the public folder inside the red mine directory to serve Redmine as a website. 
 Please make sure you tick _Allow overrides using .htaccess file_ in the advanced settings of your website configuration. 


 For further information please see 
 [[RedmineInstallOSXServer|HowTo Install Redmine on Mac OS X Server]] 10.6 Snow Leopard 
 and 
 [[RedmineInstallOSXLionServer|HowTo Install Redmine on Mac OS X Lion Server]] 
 in case some details are missing here. 
 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/