Thank you for this excellent guide. I succeed to install redmine by this way. My configuration is Xubuntu 14.04 and I needed to make some changes but I don’t think it is specific to Ubuntu :

– For the installation of RVM in Multi-user, I didn’t succeed with your method and I follow the install documentation on RVM site and it works : Under : curl -sSL https://get.rvm.io | sudo bash -s stable –ruby=2.0.0 sudo adduser rvm

– When I run bundle install … there is an error with bundler. This was because bash was started as an interactive non-login shell. After running : /bin/bash –login all was Ok.

– I needed to reboot before installing passenger

– Apache : The package apache2-threaded-dev is now replaced by apache2-dev. For recent version of apache the content of passenger.conf must be split in 2 files. In /etc/apache2/mods-available/passenger.load the LoadModule directive In /etc/apache2/mods-available/passenger.conf the “<IfModule … ” directives. Activate module with a2enmod passenger and restart apache In redmine.vhost “Options Indexes FollowSymLinks -MultiViews” should be replaced by “Options +Indexes +FollowSymLinks -MultiViews” And lines “Order allow,deny / allow from all” by “Require all granted”

It was necessary for me to add the equivalent of redmine.domain.com /etc/hosts

Thank you for your feedback FXS. I tested that install on a fresh Debian 7 minimal net-install. I will use your feedback to write the equivalent article for Ubuntu 14.04 as it seems to be a more common choice. Why is the +Indexes option required? Thanks!

Martin, this is a great guide. With this guide and the comments from FXS I was able to get a working install of redmine 2.5.1.stable.13127 on ubuntu server 14.04LTS.

I need to migrate the database from redmine version 2.3.2 into the 2.5.1 version. Could you offer some advice or a pointer for doing that? My initial attempt with the redmine_bak process documented on the redmine site was not successful. 2.5.1 generates internal server errors after trying the database import.

Hello Clinton, Thank you for your comment. From what I understand, you are migrating from a server to a new one running Ubuntu 14.04. If so, you need to, on the old server: * Backup your DB: mysqldump -u -p > /path/to/backup/db/redmine_`date +%y_%m_%d`.sql * Copy required files over to the new server: ** secret token: config/initializers/secret_token.rb ** Your files(Redmine attachments): files/* ** Your DB backup over to the new server ** You may want also to save your settings file config/settings.yml as it contains email configuration and secret for LDAP passwords. Copying files with scp looks like:scp /opt/redmine/current/files/* newserver:/opt/redmine/current/files/ Then on the new server: * Restore the DB: mysql -u -p < /path/to/backup/db/redmine_`date +%y_%m_%d`.sql * Migrate the DB: bundle exec rake db:migrate RAILS_ENV=production * Get compatible versions of the plugins you use * Restart your instance: service apache2 restart

Note that you need to create the DB before restoring the backup if you didn't do it yet:CREATE DATABASE redmine CHARACTER SET utf8;

I now have my data migrated from 2.3 to 2.5. The basic problem is that if you create a functional 2.5 site with a 2.5 database you have to delete the 2.5 database first (no one mentions this), then create a blank database and then import the 2.3 database.

The 2.5 database has tables that do not exist in 2.3 and the command: “bundle exec rake db:migrate RAILS_ENV=production” will stop if it encounters an existing table leaving you with a broken database.

So, here are the general steps:

1. Get a working 2.5 site. 2. Log into mysql as the superuser and drop the redmine database. 3. Import the data from your old site with mysql -u -p databasename < /path/to/oldsite_backup/db/databasename.sql 4. Run bundle exec rake db:migrate RAILS_ENV=production in the root directory of your redmine install (the location of your Gemfile file) or if you followed Martin's guide – /opt/redmine/current.

I'm really impressed this worked. Everyone who has worked on this project should be congratulated for their fine work.

I really like Martin's setup since this structure will make it easy to create a symlink to a future update and just point the current directory to whatever happens to be current. Thanks again Martin for your contributions!

The structure I use in production is actually self-contained in /opt/redmine, I symlink all the configuration files. It was proved not to be so useful over the years because the update process goes very smoothly. The only problem I got is plugins that are not compatible and need updating.

Great guide! Got it working, only problem I had was that redmine was not connecting to the database, I had to run a “mysqld –skip-grant-tables”. But now, for production, I need to use PostgreSQL. Do you know what changes in this guide to use PostgreSQL(libs, gems, etc)?

Hi Vinicius, Thanks for your comment. I added a FLUSH PRIVILEGES; that should solve the problem you experienced. I didn’t add it in the first place because it worked without during my test installs. To use PostgreSQL, you just need to create the database and configure it correctly with the PG adapter in database.yml. The only thing is that you will need the dev lib to be able to build the PG gem when you will run a bundle install.apt-get install libpq-dev should install to correct dependency to be able to successfully install the PG gem. You will find some instruction on installing with Postgre in the official instructions. Cheers,

Thanks for this guide. But i have a problem. All the procedure was fine but at the last step, when i wanted to log in redmine, i’ve got an error 500 … Do you have any idea ? I worked with a fresh install of debian 7.5 (netinst).

Hello JS, Can you please check the content of the logs. It can be in the Apache log:tail -100 /var/log/apache2/error.log tail -100 /var/log/apache2/redmine.error.log Or in the Redmine log:tail -100 /opt/redmine/current/log/production.log Cheers,

thank you for this guide, I used a ubuntu 14.04 virtual machine image to try it, and only two issues came up:

1. ‘bundler’ was not already installed on the vm, so i included it into the first line of apt packages to install. (I later read your update on having to relog the user)

2. The website didn’t come up. It still shows the default “Hello apache” site and won’t switch to the redmine install.

Error and access log of apache do not give any clue. The apache running is v2.4.7. On the first glance, i didn’t see anything wrong with the redmine.vhost and redmine-rediract.vhost either. Could you give a clue?

Hey Martin, Very well done installation guide! Naturally, I have a twist…We’ve been using redmine with jruby.

I think it’s almost ready to go but I’m getting the following error when I restart apache: Syntax error on line 10 of /etc/apache2/sites-enabled/000-default: Invalid command ‘RailsBaseURI’, perhaps misspelled or defined by a module not included in the server configuration Action ‘configtest’ failed. The Apache error log may have more information.

I don’t see any obvious syntax errors and the the error log has no entries from today.

RailsBaseURI /redmine PassengerResolveSymlinksInDocumentRoot on

Am I missing some quotes somewhere? Any suggestions on where I should look to debug?

Again, thanks so much for putting this guide out there. I’ve been looking for something along these lines for quite a while.

Hello John, It seems like Passenger is not loaded. Check how you load passenger, the clean what to do it on Debian is in: /etc/apache2/conf.d/passenger.conf/etc/apache2/conf.d/* is loaded before the sites. (Unless you hacked in the config files) Hope it helps. Cheers,

as I said, your standard setup works very well according to your tutorial. I was trying to move the redmine Installation to a suburi like https://xxx.xxx.xxx.xxx/redmine. However, I can’t get this to work. Can you point me to a resource to go to during my investigation?

Martin: EXCELLENT instructions! Installed on my Raspberry Pi in two tries. First try failed because I’d installed rvm for personal use, and subsequent scripts got the wrong version of Ruby in some cases, resulting in a very confused install.

For those who want to do this on Raspbian: my config is Model B PI, not overclocked, 256MB allocated to video (only 256MB to system — might want to decrease video to 128MB for this install since I think there was a good deal of swapping during compiles). OS running on an 80GB USB-attached hard drive. Linux Pi-2 3.12.22+ #691

Read Martin’s instructions and all the comments, especially noting those of FXS since they apply to this install on Raspbian, and follow pretty much exactly as given by Martin subject to FXS’s modifications. As prep for the second install, knowing that I’d had confusion with the “native” ruby 1.8.x and 1.9.x, I removed the link “/usr/bin/ruby” (just the link, not the /usr/bin/ruby1* files). As a result, “ruby -v” fails: the system can no longer confuse earlier versions with the 2.0.0 version you’re about to install.

After a successful install, I did a source /usr/local/rvm/scripts/rvm from both the pi account and root account, to make sure that “ruby -v” gave a response, indicating that the correct version of ruby was being referenced.

As you follow the rest of the instructions, some steps will fail because the parent directory is protected against writes; “ls -lad” the directory, noting protection; “sudo chmod 777” the parent directory; rerun the step; and then “sudo chmod 755 [generally it was 755 to start with]” the directory back again. That’s really the only sort of diversion in the procedure that’s needed.

Expect VERY long compile times at the steps bundle install –without development test and passenger-install-apache2-module — perhaps up to 2 hrs each. Just be patient … eventually they finish.

On first connection to the web service, the service times out waiting for a response. Let it, then try again and it starts up. (Same thing happens after a reboot of the Pi, as it loads the processes on first web reference … might perform better on a Pi configured with only 128MB of video RAM). Performance is quite reasonable after the first startup.

I connect with a web address of “pi-2/redmine” (the Raspberry Pi has hostname “pi-2”). I haven’t been able to get virtual host web connection to work (e.g., redmine.pi-2). I’m guessing that’s because I don’t have a FQDN for the Pi or named in the config files … not important to me at this point for testing. But I didn’t finish up with FXS’s edits on the vhost file, so I’ll go back and see if that fixes it.

Again, Martin, thanks for the excellent instructions: clear, precise, and systematic. I hope my additions will help those who want to set up redmine 2.5 on a Raspberry Pi.

Following up on my earlier post regarding installation of redmine 2.5 on Raspian / Raspberry Pi, I applied the redmine.vhost edits suggested by FXS (above)

In redmine.vhost “Options Indexes FollowSymLinks -MultiViews” should be replaced by “Options +Indexes +FollowSymLinks -MultiViews” And lines “Order allow,deny / allow from all” by “Require all granted”

Applying both caused the web internal service to fail completely, but leaving the first installed and reversing the second, so it was unchanged from the original .vhost file, resulted in a working server that responds to both /redmine and redmine.

Hello, I’m sorry to hear about your trouble. I’m pretty sure I had the indentation right at some point. Might have lose it when I changed highlighting plugin. I corrected the indentation and added a warning message. Thanks for your contribution!

Hello Supal, If the user is correct then you should look at the following: * Did you preserve correctly the indentation in the database.yml? (it’s whitespacwe sensitive. Use an editor such as Notepad++ able to show the whitespaces and EOL) * Are you using the wrong Rails environment? (for example development instead of production). Each environment has a different database configuration.

Everything concerning redmine works great, I am however having trouble with the redmine_create-git plugin: I get the following error when upon creating a project I click on the “Quick create [Crate Git plugin] link:

Hello Mike, Sorry for the late reply I was on holidays. You didn’t configure the settings of the plugin I presume. Try to configure it in the plugin page and try again. I need to add a fail-safe here… Thanks for the feedback!

Hi Han, Sorry for the late reply, I was on holidays. It seems you followed the Ubuntu article. In passenger.conf, replace the $user by the name of your user. $user is a variable, it changes according to which user is calling it. Make sure the files actually exist in the specified path. Cheers,

Hi Rafael, Which OS/Version of Apache2 are you using? A quick fix would be for you to remove the following lines from redmine.vhost:SSLProtocol +TLSv1.2 +TLSv1.1 +TLSv1 SSLHonorCipherOrder on SLCipherSuite "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:RC4-SHA:AES256-GCM-SHA384:AES256-SHA256:CAMELLIA256-SHA:ECDHE-RSA-AES128-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:CAMELLIA128-SHA"

I did the whole process in a test server on my network. The entire process was executed and all errors were corrected. Now I need to access via internal server ip this bar redmine. http://10.0.0.100/redmine How could I change the settings in my case?

Syntax error on line 81 of /etc/apache2/sites-enabled/redmine.vhost: Can’t locate Apache2/Redmine.pm in @INC (…) at (eval 2) line 2.\n Action ‘configtest’ failed. The Apache error log may have more information. failed!

Hi Paul, It seems you missed or had a problem with this command:ln -s /opt/redmine/current/extra/svn/Redmine.pm /usr/lib/perl5/Apache2/ Can you please run it and restart Apache? That should solve the problem. Cheers,

For both instances of this in the config options for the site. I also had to symlink to apache instead of apache2 for the perl symlink. After doing this it resolved my “Internal Server Error 500” when accessing svn via webdav.

Thanks for this excellent tuto. I was able to install your redmine plugin as well. I can now create a repository for q specific project but how did I clone/commit from a remote machine ?

I tried to install the Redmine Checkout plugin since it is mentioned in the configuration of the Create Git plugin but it seems that it is not alive anymore and faced errors related to different gems versions.

wrong number of arguments (2 for 1)/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/relation.rb:327:in `update_all’ /var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/querying.rb:8:in `update_all’ /home/redmine/redmine/redmine-3.0.0/plugins/redmine_checkout/db/migrate/20100426154202_rename_render_link_to_render_type.rb:11:in `up’ … Any idea where to find (a working version of) this useful plugin? TiA

Yes indeed I saw your post on the Redmine site and I used the one you mentioned. It seems to work fine but … 😉 If I create a project in Redmine using create_git plugin then redmine_checkout gives me a URL. When trying to clone from my laptop I nevertheless get this:

I’m using the plugin you created, but I can’t it get to work with redmine_checkout plugin that you suggested. I’ve cloned the project and made all the instructions given for installation of redmine_checkout plugin but got no success to make it work. After command ‘rake redmine:plugins:migrate RAILS_ENV=production’ for redmine_checkout plugin I sees this error:

Hi Martin, first of all, thank you for this excellent guide! works great!

However, there is a question: How would you update all the installed components on Debian 7?

I tried \”gem update\” and after a very long automated update process (which also adds a lot of new gems) , I ended up with a \”Web application could not be started superclass mismatch for class Mark (TypeError)\” on my redmine web frontend. I googled this error and found out that I had to perform \”rvm implode\” and redo the rvm install. I did it, and performed all your steps from the beginning, this time

including \”redmine 2.6-stable current\” in the svn command. All installation was running fine and in the end, my server was up & running again with redmine 2.6.2. Hooray!

BUT: When I run \”gem update\” again, a lot of new gems and updates are installed and again my redmine web frontend is unavailable. I eventually removed the gem \”psych\” and this helped.

So my general question is, how to avoid this? Is Updating the gems with \”gem update\” not the recommended way?

When you update Redmine, a simple bundle install should do. The bundler will fetch only gems compatible with the application (Redmine) as defined in the Gemfile. You can also instruct the bundler to fetch newer but still compatible gems with bundle update. Note that you must be in Redmine’s directory to use the bundler (directory where the Gemfile is located).

This is easily the best redmine tutorial i\’ve found. I wonder if you would be able to give the best way to update to a completely new version of redmine for someone that used this guilde. For example, if I used this guide while 2.5.3 was out, I\’ve seen tons of guides that say just run svn update, then bundle update, but this still tries to 2.5.3. Is running an svn relocate or svn switch to the newest version the best way, or is there an easier method?

Great guide Martin! With you guide, I can install redmine with minimal experience with debian (Not an IT major).

So… i have some question. 1. Now, i can access my redmine from local, but only with https://. Can i make it so i can access it without the https? so like only 192.168.1.200 not https://192.168.1.200

2. I want to incorporate redmine in my local computer to my website with external hosting, any resources i can read to do it @@. I have limited experience with debian, so any resources/search terminology is appreciated!!

Hello Kevin, Thanks for the feedback! 1. To remove SSL support, run:a2dissite redmine-redirect edit: /etc/apache2/site-enabled/redmine.vhost Replace “” by “” Delete all the lines related to SSL, starting with “SSLEngine on” ending with “SSLStaplingCache”. Dont forget the “Strict-Transport-Security” part. Remove the top line “NameVirtualHost *:443” Then restart Apache: service apache2 restart 2. I’m not sure I got it but if you have a dedicated server/VPS running Debian, you could just install it there?

i\’m facing a trouble on my plesk 12 debian 7 server, i used to have redmine installed on a plesk 9 , and i\’m trying to restore all this on this new server. i copy paste the files i had on the old server to the var/www/vhost/domaine/redmine , i created the database redmine and import the dump, i installed ruby 1.9.1 , gems, passenger_module (it is running), my document root is DocumentRoot \”/var/www/vhosts/domaine/redmine/public\” on httpd.conf , but each time i\’m calling the http://redmine.domaine.fr/ , i have the :

Forbidden You don\’t have permission to access / on this server.

on the error.log : Directory index forbidden by Options directive

i did chmod 755 and even 777 on the redmine directory, tried to set it at www-data as user:group or psacln or psasrv (plesk common groups for regular website) … but nothing changes.

You might want to scan you config for a Deny statement. Also, could there be a .htaccess somewhere? I suggest you try posting on the Redmine forum at https://redmine.org/projects/redmine/boards There might be people with Plesk experience there. Cheers, -Martin