Project

General

Profile

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