Installing Redmine on Solaris 11.1
Added by Jack McMara over 11 years ago
[Edited original post with a successfully verified procedure]
Redmine installation¶
The following instructions are based on the information found here:
http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Solaris
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
System hosts a clean installation of Oracle Solaris 11.1, up to date as of 2013.11.13.
Important:
Support libraries are installed outside the system. I have a second installation directory at:
/dtank/general/install/
The following procedure installs everything needed in the above directory leaving the system (mostly) untouched.
Installation procedure¶
Step 1. Ensure PATH and LD_LIBRARY_PATH are set correctly.¶
Edit ~/.bashrc file and add:
export PATH=$PATH:/dtank/general/install/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/dtank/general/install/lib
Step 2. Install mysql from Solaris package manager.¶
After that, enable the service:
svcadm enable mysql
Step 3. Install mysql connector.¶
Download 32 bit version of Connector/C it from here:
http://dev.mysql.com/downloads/connector/c/#downloads
(In fact, the 64 bit version failed. Ruby must be compiled by default with 32 bit.)
Place it into:
/dtank/general/Work/design/packages¶
After extracting it, install with the following commands:
cd /dtank/general/Work/design/packages/mysql-connector-c-6.1.2-solaris11-i386/ gcp -v -P -r bin/* /dtank/general/install/bin/ gcp -v -P -r lib/* /dtank/general/install/lib/ gcp -v -P -r include/* /dtank/general/install/include/
Step 4. Install Ruby from source.¶
At this time the latest stable version is Ruby 2.0.0-p353:
cd /dtank/general/Work/design/packages wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz tar -xzvf ruby-2.0.0-p353.tar.gz rm ruby-2.0.0-p353.tar.gz cd ruby-2.0.0-p353 ./configure --prefix=/dtank/general/install/ make make install
Step 5. Configure environment.¶
Edit ~/.bashrc
file and add:
export GEM_PATH=/dtank/general/install/lib/ruby/gems/2.0.0/
Be sure to reload ~/.bashrc
before proceeding further.
Step 6. Install gems for Redmine:¶
gem update --system gem update gem install rake gem install rails gem install mysql2 gem install bundler
Step 7. Uninstall psych update.¶
The `gem update`
operation above installed an update to psych, which is incompatible with Redmine.
Remove the update with the following commands:
gem uninstall psych
Select 1 at the prompt (i.e. remove version psych-2.0.1
).
Step 8. Download Redmine¶
The link for the latest stable version can be found here:
http://rubyforge.org/frs/?group_id=1850
As of today, the latest stable version is 2.4.0. With this assumption, the download steps are:
cd /dtank/general/Work/design/packages wget http://rubyforge.org/frs/download.php/77242/redmine-2.4.0.tar.gz tar -xzvf redmine-2.4.0.tar.gz rm redmine-2.4.0.tar.gz cd /dtank/general/install ln -s /dtank/general/Work/design/packages/redmine-2.4.0 redmine
Step 9. Create an empty database and accompanying user¶
Redmine database user will be named redmine hereafter but it can be changed to anything else.
Assuming that mysql has never been run, a root password must be set first.
shell> mysql -u root mysql> UPDATE mysql.user SET Password = PASSWORD('newpwd') -> WHERE User = 'root'; mysql> FLUSH PRIVILEGES;
Test:
mysql> quit shell> mysql -u root -p
Continue with creation of database for Redmine:
mysql> CREATE DATABASE redmine CHARACTER SET utf8; mysql> CREATE USER 'mcmara'@'localhost' IDENTIFIED BY 'my_password'; mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'mcmara'@'localhost';
Check users:
mysql> SELECT User, Host, Password FROM mysql.user;
Step 10. Database connection configuration.¶
Copy config/database.yml.example
to config/database.yml
and edit this file in order to configure your database settings for "production" environment:
cd /dtank/general/install/redmine cp config/database.yml.example config/database.yml emacs config/database.yml
Edit only the first section as follows;
production: adapter: mysql2 database: redmine host: localhost username: mcmara password: "my_password" encoding: utf8
Step 11. - Dependencies installation.¶
cd /dtank/general/install/redmine bundle install --without development test rmagick
Step 12. Session store secret generation¶
This step generates a random key used by Rails to encode cookies storing session data thus preventing their tampering.
Generating a new secret token invalidates all existing sessions after restart.
cd /dtank/general/install/redmine rake generate_secret_token
Step 13. Database schema objects creation¶
Create the database structure, by running the following command under the application root directory:
cd /dtank/general/install/redmine RAILS_ENV=production rake db:migrate
Step 14. Test the installation¶
Test the installation by running WEBrick web server:
ruby script/rails server webrick -e production
Step 15. Install FCGI packages from Solaris package manager.¶
Required packages are:
fastgci apache-fgcid
After that, restart Apache:
svcadm restart apache22
Step 16. Install fcgi gem:¶
gem install fcgi
The following step is necessary to avoid the fcgi error:
cd /dtank/general/install/redmine echo "gem \"fcgi\"" > Gemfile.local
Step 17. Create .htaccess¶
cd /dtank/general/install/redmine/public cp htaccess.fcgi.example .htaccess
Step 18. Edit apache configuration¶
The Apache 2 configuration file in Solaris is located here:
sudo emacs /etc/apache2/2.2/httpd.conf
Modify the document root under your virtual host as following:
[...] <VirtualHost _default_:443> # General setup for the virtual host DocumentRoot "/var/apache2/2.2/htdocs/redmine/public" [...]
Under the SSL section (it is assumed you have SSL correctly setup), add the following section:
# redmine FcgidInitialEnv LD_LIBRARY_PATH /dtank/general/install/lib FcgidInitialEnv RAILS_ENV production <Directory "/var/apache2/2.2/htdocs/redmine/public"> AddHandler fastcgi-script fcgi Order allow,deny Allow from all AllowOverride all Options +FollowSymLinks +ExecCGI RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi AuthType Basic AuthName "Restricted Files" AuthUserFile /usr/apache2/2.2/passwd/passwords Require user <username> </Directory>
Replace <username> as you like.
Ensure then that the syntax if OK:
/usr/apache2/2.2/bin/httpd -t
Create a symlink to redmine into the document root:
cd /var/apache2/2.2/htdocs/ sudo ln -s /dtank/general/Work/design/packages/redmine-2.4.0 redmine
Step 19. Restart Apache¶
Finally restart Apache:
svcadm restart apache22
Enjoy!
Replies (1)
RE: Installing Redmine on Solaris 11.1
-
Added by Jack McMara over 11 years ago
Edited original post with a valid procedure, successfully tested on 2013.11.23.