RedmineInstallOSXLionServer » History » Version 1

Art Kuo, 2012-06-02 01:03

1 1 Art Kuo
h1. Installing Redmine on Mac OS X 10.7 Lion Server
2 1 Art Kuo
3 1 Art Kuo
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.
4 1 Art Kuo
5 1 Art Kuo
h2. Step by Step
6 1 Art Kuo
7 1 Art Kuo
h3. Install Prerequisites 
8 1 Art Kuo
9 1 Art Kuo
# Install Xcode/OS X Developer Tools
10 1 Art Kuo
Install from the Mac App Store or register for a free account and download from: https://developer.apple.com/downloads/
11 1 Art Kuo
# Install OS X MySQL and associated Libraries
12 1 Art Kuo
Download http://www.mysql.com/downloads/mysql/
13 1 Art Kuo
Select latest 64-bit version, e.g. 5.5.25  
14 1 Art Kuo
Run the installation package *.pkg* file. This will install into */usr/local/mysql/bin* 
15 1 Art Kuo
Run the MySQLStartupItem.pkg file to use GUI to start automatically after startup of your server. (Of course, command line also works.)
16 1 Art Kuo
Open the MySQL.prefPane and install for all users. This provides a GUI for starting and stopping. (Of couse, command line also works.)
17 1 Art Kuo
Set the root password for your new installation of MySQL. One way is to use the MySQLWorkbench:http://www.mysql.com/products/workbench/. Or from the command line:
18 1 Art Kuo
  *mysqladmin -u root password NEWPASSWORD* where your password substitutes for NEWPASSWORD
19 1 Art Kuo
Add MySQL to the path
20 1 Art Kuo
  In terminal:
21 1 Art Kuo
    *sudo touch /etc/paths.d/mysql* (creates a file in which you type the path)
22 1 Art Kuo
    *sudo nano /etc/paths.d/mysql*
23 1 Art Kuo
  In editor type */usr/local/mysql/bin* then save and exit
24 1 Art Kuo
Enter startup options to tell the MySQL client and daemon to connect to the local server.
25 1 Art Kuo
  In terminal:
26 1 Art Kuo
    *sudo nano /etc/my.cnf*
27 1 Art Kuo
  In editor, add the following as appropriate:
28 1 Art Kuo
    [mysqld]
29 1 Art Kuo
    socket = /tmp/mysql.sock
30 1 Art Kuo
    [client]
31 1 Art Kuo
    socket = /tmp/mysql.sock    
32 1 Art Kuo
http://www.opensource.apple.com/other/MySQL-53.binaries.tar.gz (or MySQL-54 for OSX 10.6.7)
33 1 Art Kuo
	@sudo tar -xvf ~/Downloads/MySQL-53.binaries.tar -C ~/Downloads@
34 1 Art Kuo
or if you downloaded a .gz file,
35 1 Art Kuo
	@sudo tar -xzvf ~/Downloads/MySQL-53.binaries.tar.gz -C ~/Downloads@
36 1 Art Kuo
This will produce a root.tar archive, which must then be extracted
37 1 Art Kuo
	@sudo tar -xzvf ~/Downloads/MySQL-53.binaries/MySQL-53.root.tar.gz -C /@
38 1 Art Kuo
If successful, tar should list the many files being placed in appropriate locations 
39 1 Art Kuo
# Install Ruby Gems
40 1 Art Kuo
	@sudo gem install rails -v=2.3.5@
41 1 Art Kuo
	@sudo gem install rack -v=1.0.1@
42 1 Art Kuo
	@sudo gem install rake -v=0.8.3@
43 1 Art Kuo
	@sudo gem install fastthread@
44 1 Art Kuo
	@sudo env ARCHFLAGS="-arch x86_64" gem install mysql -v=2.8.1@
45 1 Art Kuo
# If you are running desktop OS X  (not the Server edition):  See [[RedmineInstallOSX]]
46 1 Art Kuo
# If you are running OS X *Server*: Install Passenger
47 1 Art Kuo
	@sudo gem install passenger@
48 1 Art Kuo
	@sudo passenger-install-apache2-module@
49 1 Art Kuo
The apache2 module installation will ask you to add several lines to the apache configuration file. Some likely locations for this are /etc/apache2/httpd.conf (standard OS X Server installation) and /opt/local/apache2/conf/httpd.conf (MacPorts installation).
50 1 Art Kuo
# Install Passenger Pref Pane
51 1 Art Kuo
Download and Install: http://www.fngtps.com/passenger-preference-pane
52 1 Art Kuo
53 1 Art Kuo
h3. Install Redmine
54 1 Art Kuo
55 1 Art Kuo
# Checkout Redmine
56 1 Art Kuo
	@cd /Library/WebServer/Sites/@
57 1 Art Kuo
	@sudo svn checkout http://redmine.rubyforge.org/svn/trunk redmine@
58 1 Art Kuo
# Configure Passenger
59 1 Art Kuo
	Open /Library/WebServer/Sites/redmine in Finder
60 1 Art Kuo
	Start Passenger preference pane in System Preferences
61 1 Art Kuo
	Drag redmine folder to Passenger (you may have to 'click to make changes')
62 1 Art Kuo
	Set "Address" and click "Production"
63 1 Art Kuo
# If you are running desktop OS X  (not the Server edition):  See [[RedmineInstallOSX]]
64 1 Art Kuo
# If you are running OS X *Server*: Enable MySQL
65 1 Art Kuo
	Launch Server Admin, click + Sign, Add Service, Check MySQL box, click Save
66 1 Art Kuo
	Choose the MySQL service, click Set Root Password, click Start to start the service
67 1 Art Kuo
# Setup Database
68 1 Art Kuo
	@mysql -u root -p@
69 1 Art Kuo
<pre>	create database redmine character set utf8;
70 1 Art Kuo
	create user 'redmine'@'localhost' identified by 'my_password';
71 1 Art Kuo
	grant all privileges on redmine.* to 'redmine'@'localhost';</pre>
72 1 Art Kuo
# Configure Redmine
73 1 Art Kuo
	@cd /Library/WebServer/Sites/redmine@
74 1 Art Kuo
	@sudo mkdir tmp public/plugin_assets@
75 1 Art Kuo
	@sudo chmod -R 755 files log tmp public/plugin_assets@
76 1 Art Kuo
	@sudo cp config/database.yml.example config/database.yml@
77 1 Art Kuo
Edit database.yml, ie.:
78 1 Art Kuo
<pre>
79 1 Art Kuo
production:
80 1 Art Kuo
  adapter: mysql
81 1 Art Kuo
  database: redmine
82 1 Art Kuo
  host: localhost
83 1 Art Kuo
  username: redmine
84 1 Art Kuo
  password: my_password
85 1 Art Kuo
</pre>
86 1 Art Kuo
# Establish Defaults
87 1 Art Kuo
	@sudo rake generate_session_store@ (may require gems i18n and updated rails)
88 1 Art Kuo
	@sudo RAILS_ENV=production rake db:migrate@
89 1 Art Kuo
	@RAILS_ENV=production rake redmine:load_default_data@
90 1 Art Kuo
(If rails cannot access log file, do this: @sudo chmod 0666 log/production.log@)
91 1 Art Kuo
92 1 Art Kuo
h3. Try out using webrick
93 1 Art Kuo
94 1 Art Kuo
# Run the ruby web server with @ruby script/server webrick -e production@
95 1 Art Kuo
# Go to a web browser and view @http://localhost:3000@
96 1 Art Kuo
There may be some errors. An error regarding undefined "csrf_meta_tag" can be dealt with by deleting the corresponding line in app/views/layouts/base.rhtml (perhaps line 8, but use the error message to be sure of proper line).
97 1 Art Kuo
98 1 Art Kuo
For automated installs, check out [[How to install Redmine in Linux Windows and OS X using BitNami Redmine Stack]]