Update 2018-07-14:
An updated version is available for Debian 9 and Redmine 3.x
Update 2014-07-12:
Added troubleshooting suggestions and warning about multiple services running on the server.
Update 2014-07-10:
Added details about self-signed certificates.
Update 2014-05-20:
Added support for HSTS and commented OCSP stapling.
Before starting:
We will prefer to work in the new, clean Virtual Machine. My preference goes to XenServer which can run on top of almost any hardware (Configure backups!).
I recommend you give at least 1GB of RAM to your Redmine box.
Before anything else, we will make sure that the packages are up to date:
apt-get update && apt-get upgrade
Getting Ruby
The compatibility list is available on Redmine’s official website. As time of writing, Ruby 2.1.x is NOT supported.
Install Ruby 2.0.0 with RVM:
apt-get install curl
curl -sSL https://get.rvm.io | bash -s stable --ruby=2.0.0
su - #Reload user variables, alternatively you can relog
Note that you can list available rubies with:
rvm list known
Getting Redmine
We will also want to to use Subversion to checkout Redmine and Git for our SCM
apt-get install git subversion
Redmine dependencies
apt-get install imagemagick libmagickwand-dev
Get Redmine, as time of writing, the newest stable branch is 2.5-stable.
cd /opt/
mkdir redmine
cd redmine/
svn co http://svn.redmine.org/redmine/branches/2.5-stable current
cd current/
Fix permissions:
mkdir -p tmp tmp/pdf public/plugin_assets
chown -R www-data:www-data files log tmp public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets
Create repositories root
mkdir -p /opt/redmine/repos/svn /opt/redmine/repos/git
chown -R www-data:www-data /opt/redmine/repos
Create the MySQL database
We will use MySQL, note that the dev library is required to compile the mysql2 gem native extention
apt-get install mysql-server libmysqlclient-dev
We start the MySQL Console to create the database:
mysql -uroot -p
Then, in the MySQL console:
CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Configure Redmine
Time to edit the Redmine configuration:
cp config/configuration.yml.example config/configuration.yml
cp config/database.yml.example config/database.yml
nano config/database.yml
Edit such as:
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "my_password"
encoding: utf8
Don’t forget to replace “my_password” by your actual password created earlier.
Let the bundler install the Gem dependencies:
bundle install --without development test
Ready Redmine’s database:
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data
Install and configure the web server
We need a bunch of packages
apt-get install apache2 apache2-threaded-dev libcurl4-gnutls-dev apache2 libapache2-svn\
libapache-dbi-perl libapache2-mod-perl2 libdbd-mysql-perl libauthen-simple-ldap-perl openssl
Time to enable the required modules:
a2enmod ssl
a2enmod perl
a2enmod dav
a2enmod dav_svn
a2enmod dav_fs
a2enmod rewrite
a2enmod headers
We install Passenger to serve Redmine:
gem install passenger
passenger-install-apache2-module
Follow the instructions at the end of the Passenger installation to create your Passenger Apache configuration. Do NOT copy the example below as it will very probably fail. It should look like:
/etc/apache2/conf.d/passenger.conf
# Do NOT copy this configuration file, you need to create your owen with the output of `passenger-install-apache2-module`
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.41/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.41
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.0.0-p451/wrappers/ruby
</IfModule>
Load the Redmine.pm library for Repository authentication
ln -s /opt/redmine/current/extra/svn/Redmine.pm /usr/lib/perl5/Apache2/
Create SSL Self-signed certificate
If you are not familiar with self-signed certificates, please read:
SSL provides 2 protections: 1: Encryption (prevents eavesdropping) 2: Authentication of the server (prevents a malicious server to pretend to be your server).
Self-signed certificates only provide encryption. It means that browsers will display a warning telling that the authenticity of the certificate could not be verified. To prevent that, you can:
- Remove SSL by haveing only a VirtualHost on port 80(which is arguably acceptable for an isolated private network)
- Get a free valid certificate for example from StartSSL
- Purchase a valid certificate from a vendor of your choice
Gurus out there will know that it is actually more to it but it is not the topic of this article.
I use self-signed certificates for this article because it is simple, immediate, free and better than nothing.
We create the certificate with OpenSSL. Set the “Common Name” to the name of your domain name for example redmine.domain.com
mkdir /etc/apache2/ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/apache2/ssl/redmine.key -out /etc/apache2/ssl/redmine.crt
Apache2 configuration
We can now create our Apache2 configuration files:
Files should be placed in /etc/apache2/sites-available/
Alternatively, you can download the files directly on the server:
cd /etc/apache2/sites-available
wget https://gist.githubusercontent.com/martin-denizet/11080033/raw/46d6da9217aa249eda8d0203102380e1ba62f774/redmine.vhost
wget https://gist.githubusercontent.com/martin-denizet/11080033/raw/8cc96e73a43d9ff65b855c9dc1b81c05897ab7fc/redmine-redirect.vhost
a2dissite default
If you were using the default configuration for other services, disabling it would make these services unavailable.
Enable the configuration:
a2dissite default
a2ensite redmine.vhost
a2ensite redmine-redirect.vhost
service apache2 restart
Time to Celebrate!
There you go, your Redmine instance should be up in running!
Test it at http://redmine.domain.com (replace with your settings)
Username: admin
Password: admin
What now
You may want to check that your configuration is correct in https://redmine.domain.com/admin/info
You may also want to configure your email server in: /opt/redmine/current/config/configuration.yml
[Optional] Install Create Git plugin
cd /opt/redmine/current/plugins/
git clone https://github.com/martin-denizet/redmine_create_git.git
bundle install
service apache2 restart
This was a wonderful guide! Thanks! How can you integrate SVN and GIT to create repositories on project creation?
Hello Eric,
To create Git repositories to my knowledge you have 2 options:
* https://github.com/jbox-web/redmine_git_hosting (Full featured)
* https://github.com/martin-denizet/redmine_create_git (Simpler, works only with Smart HTTP)
I never tried redmine_git_hosting, I’d be glad to hear about it if you choose to use it.
For SVN, I don’t know a solution because I didn’t work with it for a while.
Cheers!
Hello,
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 hope I didn't forget anything.
Cheers,
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!
I left out a step:
Insert this step between 2 and 3.
2.5 Create a blank redmine database:
CREATE DATABASE redmine CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON redmine.* TO ‘redmine’@’localhost’;
Note: You have already created the redmine user – no need to create the user again.
Hi Clinton,
Glad you got your migration working!
Minor updates like 2.5.2 will be as simple as:
* svn update (get laltest from 2.5-stable branch)
* bundle update (Update environment)
* bundle exec rake db:migrate RAILS_ENV=production (Update the database schema)
* service apache2 restart
Of course it’s advised to do a backup before.
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.
I’ll write about that in a future article.
Cheers!
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)?
Thanks
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 Martin! It worked fine!
Cheers
@Martin DENIZET
Hello,
Without “+” I have this following error “Either all Options must start with + or -, or no Option may”.
Indeed, I experienced the problem when writing the Ubuntu article (https://martin-denizet.com/install-redmine-2-5-x-git-subversion-ubuntu-14-04-apache2-rvm-passenger/).
Though I could not get Git Smart HTTP to work. Could you?
Hi Martin,
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,
I just discover the error.log in apache and there is a lot of things that i don’t understand.
the file here : http://dl.free.fr/jnbEoGC3C
Thanks you very much for your help … i’m a bit lost here.
It seems your database is not initialized.
Try to run again the migration and send me the output:
cd /opt/redmine/current
RAILS_ENV=production bundle exec rake db:migrate
Hi Martin,
I just find the problem thanks to the log.
I don’t know why but the redmine database was empty … I fix that and the connexion is ok now.
Thanks for your help and thanks again for this guide !!
Great! Good to hear your problem is solved, have a nice day!
I was following this tutorial from start to finish, but when I try to run this command:
RAILS_ENV=production bundle exec rake db:migrate
I get this error:
Could not find command “exec rake”.
Any ideas? Thank you so much.
Hello Leo,
Try this:
bundle exec rake db:migrate RAILS_ENV=production
or
rake db:migrate RAILS_ENV=production
you have to
cd /opt/redmine/current
before running the commandsTell me if it works.
Cheers,
Hi Martin,
Great write up.
‘Could not find command “exec rake”.’
This worked for me:
bundle exec rake db:migrate RAILS_ENV=production
Hi Alex,
Thank you for your feedback, it seems you’re not the only one who add this issue. It seems it works for some people but not for others and I’ve no clue why.
Cheers!
Hi Martin,
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?
Thanks again for the guide!
Hello MJ,
Thing go quite differently on Ubuntu 14.04. I wrote an article specifically for it: https://martin-denizet.com/install-redmine-2-5-x-git-subversion-ubuntu-14-04-apache2-rvm-passenger/
For the Bundler it comes directly with rvm under Debian but not on Ubuntu 14.04 (I think it’s a permission thing).
My advise is to use gem to install the bundler:
gem install bundler
For the default welcome screen showing, do:
sudo a2dissite 000-default
sudo service apache2 restart
Here again, the instruction are a little different between Ubuntu and Debian.
Tell me if it works.
Cheers,
Works like a charm indeed.
Thanks for the quick response, I will forward your work!
Great! Good to know it’s working.
Have a nice day!
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,
Hallo Martin,
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?
Thanks,
MJ
Nevermind, I just rearranged the site-config files an now it works.
Redmine 2.5 / Ruby 2.0.0 / rvm / Raspbian / Raspberry Pi Model B
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.
First modification to Martin’s instructions: install rvm and ruby 2.0.0 as root, as suggested by FXS, using
sudo curl -sSL https://get.rvm.io | sudo bash -s stable –ruby=2.0.0
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.
that should have read hostname/redmine and redmine.hostname
Hi David,
Thank you for this very interesting feedback. I’m surprised you got enough RAM to compile!
I’ll Maybe use it as a base for an article dedicated to Raspbian.
Cheers!
Hi David,
Thank you so much for sharing this excellent tutorial.
One thing though … it might be just me being dumb, but I just spent about two hours trying to get this to work. I then discovered that database.yml had to be indented like so:
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: “my_password”
encoding: utf8
This file HAS to be indented like this using spaces and NOT tabs. In your tutorial above, you don’t have any indentation when editing this file 🙂
Just thought I should share if anybody else is getting stuck on this.
ugh … the indentation doesn’t show in my comment, but every line below the ‘production:’ line has to be indented 🙂
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!
How to solve this issue?
Can’t connect to MySQL server on ‘127.0.0.1’ (111) (Mysql2::Error)
I can login through mysql -uredmine -p but redmine cannt connect to mysql server.
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.
How about you send me over your database.yml?
Successfully installed redmine following your tutorial, one shot. Thanks a lot!
Hi Julien. Awesome! Thanks for sharing your experience, it’s always great to know when contributions are useful to the community.
I wish you happy coding with your fancy new Redmine!
Hello Martin, thank you for your wonderful tutorial!
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:
NoMethodError (undefined method ’empty?’ for nil:NilClass):
plugins/redmine_create_git/app/controllers/create_git_controller.rb:44:in ‘check_settings’
…
I am running on a fresh debian wheezy installation with
ruby-2.0.0-p481
gem 2.2.2
redmine 2.5
git 1.7.10.4
Any clues as to what I might be doing wrong? Thanks!
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!
thanks for your guide reference. Unfortunately my redmine server is not working now.
My web page just show this message.
Raw process output:
*** ERROR ***: Cannot execute /home/$user/.rvm/gems/ruby-2.0.0-p481: Permission denied (13)
apache log is
[ 2014-08-07 17:30:51.2870 22171/7f565ebd9700 agents/HelperAgent/RequestHandler.h:2305 ]: [Client 20] Cannot checkout session because a spawning error occurred. The identifier of the error is . Please see earlier logs for details about the error.
App 24396 stdout:
App 24396 stderr: *** ERROR ***: Cannot execute /home/$user/.rvm/gems/ruby-2.0.0-p481: Permission denied (13)
[ 2014-08-07 17:37:23.9061 22171/7f5660d05700 Pool2/Implementation.cpp:284 ]: Could not spawn process for application /opt/redmine/current: An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger.
Error ID: 5811413f
Error details saved to: /tmp/passenger-error-uIyI8h.html
Message from application: An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger. Please read this article for more information about this problem.
Raw process output:
/etc/apache2/conf-enabled$ cat passenger.conf
LoadModule passenger_module /home/$user/.rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.48/buildout/apache2/mod_passenger.so
PassengerRoot /home/$user/.rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.48
PassengerDefaultRuby /home/$user/.rvm/gems/ruby-2.0.0-p481/wrappers/ruby
Could you have any idea?
Web application could not be started
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! I followed all the steps, but when execute service apache2 restart return error:
Syntax error on line 10 of /etc/apache2/sites-enabled/redmine.vhost:
SSLProtocol: Illegal protocol ‘TLSv1.2’
Action ‘configtest’ failed.
The Apache error log may have more information.
failed!
Can u help me?
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 installed Redmine following all the steps you showed, but now I wanted to get the HTTPS and I’m not getting. What can I be doing wrong?
Sorry, I expressed myself wrong … I want to REMOVE HTTPS.
Hi Rafael,
Sorry for the late reply.
To remove HTTPS, disable the HTTPS redirection with:
a2dissite redmine-redirect.vhost
Then edit: /etc/apache2/sites-available/redmine.vhost:
Remove:
NameVirtualHost *:443
Remove the SSL configuration:
SSLEngine on
SSLProtocol +TLSv1.2 +TLSv1.1 +TLSv1
SSLCompression off
SSLHonorCipherOrder on
SSLCipherSuite "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"
SSLCertificateFile /etc/apache2/ssl/redmine.crt
SSLCertificateKeyFile /etc/apache2/ssl/redmine.key
## Enable Strict Transport: http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security
Header add Strict-Transport-Security "max-age=15768000"
## SSL Stapling, more at: https://www.insecure.ws/2013/10/11/ssltls-configuration-for-apache-mod_ssl/
# SSLUseStapling on
# SSLStaplingResponderTimeout 5
# SSLStaplingReturnResponderErrors off
# SSLStaplingCache shmcb:/var/run/ocsp(128000)
Edit the VirtualHost listening port such as:
That should be all,
Cheers,
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?
I can now access through https://10.0.0.100:443
Everything works perfectly.
I just need to access /redmine
Keep learning..
Hello Soufraz,
This tutorial explains how to configure Redmine as a VirtualHost such as http://redmine.domain.com/.
If you want to install Redmine in http://domain.com/redmine instead, you should follow the instructions at: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI
Note that to be able to use a domain instead on an IP, you should configure DNS records. Either locally in your router or using your registrar.
Cheers,
Everything is working just fine Apache v2.4.7 (Ubuntu), however…
If I go to my repository within Redmine, I can see all the files, but I don’t see any revisions!?
Clicking on ‘all revisions’ gives me an empty page. By typing: git show, in the terminal gives me a whole list of changes/commits.
Meaning I do have commits.
Anybody?
Kind regards,
Melroy van den Berg
Somehow changing the settings at:
https://my.site.org/settings?tab=repositories
I checked the box, called: ‘Fetch commits automatically’. Suddenly it just works..
I also run your crontab command Martin. I hope it’s just working all fine from now :S.
Hi Melroy,
This is an article in my long list of articles I’d like to write when I have time.
Yes, you need to fetch the changesets for them to appear in Redmine. There is 3 ways people do that:
Cheers,
Ps.
One note for everyone: be aware of the new Apache configs within the latest Ubuntu Server LTS. Please, check out the following page:
http://httpd.apache.org/docs/2.4/upgrading.html
Please, note that I also wrote an article for Ubuntu 14.04 so you can copy/paste 🙂
If you missed the link at the top of this page, here it is: https://martin-denizet.com/install-redmine-2-5-x-git-subversion-ubuntu-14-04-apache2-rvm-passenger/
and with those repositories :
https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#install_on_debian_ubuntu
does it work too flawlessly ?
Hello Benoit,
I didn’t test but I assume it should work easily.
Don’t hesitate to give feedback if you try it 😉
Cheers,
Debian 7 – the last service apache2 restart throws an error :
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!
Nothing in Apache error log.
Haven’t got a clue…
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,
Sorry, yes that was it. Thanks !
Great to hear you got it working! 😀
Have a nice day!
Pingback: Redmine 2.5 installation guide on Debian Wheezy | SabrNET
Hi Martin,
I am getting stuck when I try “bundle exec rake generate_secret_token” . I get the following:
rake aborted!
Don’t know how to build task ‘generate_secret_token’
Any ideas?
Hello Tony,
You have to be in the Redmine directory (/opt/redmine/current) to run this command.
Please tell me if it doesn’t solve the problem.
Cheers 🙂
Hi Martin and everyone. As per a fresh netinstall of Debian 7.7 (32-bit) I had to change the redmine.vhost to reference
“PerlLoadModule Apache::Redmine” instead of “PerlLoadModule Apache2::Redmine”
And “PerlAccessHandler Apache::Authn::Redmine::access_handler” instead of “PerlAccessHandler Apache2::Authn::Redmine::access_handler”
And “PerlAuthenHandler Apache::Authn::Redmine::authen_handler” Instead of “PerlAuthenHandler Apache2::Authn::Redmine::authen_handler”
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 the tutorial!
P.S. Figured out by checking the apache2 redmine error logs and finding this:
http://www.redmine.org/boards/2/topics/42298
Hi,
Thank you for your feedback. I’ll update that very quickly!
Cheers,
Hi
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.
Any suggestions?
Cheers
Salut Guillaume,
Thank you for your feedback.
The version of Checkout plugin that works for me is this fork https://github.com/rkallensee/redmine_checkout
(Tested on Redmine 2.5.0)
Let me know if it solves your problem.
Cheers,
It does not seem to work anymore with apache2.4+redmine3.0.0.
Error is:
== 20100426154202 RenameRenderLinkToRenderType: migrating =====================
— add_column(:repositories, :render_type, :string, {:default=>”url”, :null=>false})
-> 0.3012s
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
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
Bonjour
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:
git clone https://myfqdn/git/testgit2.myrepo
Cloning into ‘testgit2.myrepo’…
fatal: unable to access ‘https://myfqdn/git/testgit2.myrepo/’: The requested URL returned error: 500
The error seems to be related to some auth issue as the apache log says:
[Mon Dec 01 14:39:53 2014] [error] [client A.B.C.D] failed to resolve handler `Apache2::Authn::Redmine::access_handler’: Can’t locate Apache2/Authn/Redmine/access_handler.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl . /etc/apache2) at (eval 17) line 2, line 558.\n
I have this:
ls -lrt /usr/lib/perl5/Apache2/Redmine.pm
lrwxrwxrwx 1 root root 37 sept. 20 16:53 /usr/lib/perl5/Apache2/Redmine.pm -> /scratch/redmine/extra/svn/Redmine.pm
but /usr/lib/perl5/Apache2/ in not in the @INC
Am I missing something ? Is that the only error ?
I am running Apache 2.2.22 on Debian Wheezy
Cheers
Hello!
Super tuto merci !
Great HowTo, thanks!
Hi, Martin
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:
rake aborted!
LoadError: cannot load such file — redmine_plugin_support
/opt/redmine/redmine-2.6.0/plugins/redmine_checkout/Rakefile:2:in `require’
/opt/redmine/redmine-2.6.0/plugins/redmine_checkout/Rakefile:2:in `’
/home/dastan/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval’
/home/dastan/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `’
(See full trace by running task with –trace)
Even though that I’ve already installed gem ‘redmine_plugin_support’.
Can you help me with this issue? Any guess, suggestions will be appreciated. Thanks in advance/
Hey, this Guide is great! Just follwed it and everything runs just perfect. You should contribte it to official redmine howtos
Pingback: Installing Redmine on Debian 7 with Plesk 12 | Sergey Kovalev
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?
Thanks in advance!
yours,
meiko
Hmpf. Must improve my google fu! Here is a detailed description how to update just the gem I want to update. http://wiki.vpslink.com/HOWTO:_installing,_updating_and_removing_rubygems
Hello Meiko,
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).
Cheers,
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?
Hello,
Thanks for your kind comment. An article about updating Redmine is long overdued.
To sum up, how I do it is:
* Backup!
*
svn update
for revisions (2.5.1 -> 2.5.2)*
svn switch http://svn.redmine.org/redmine/branches/3.0-stable
for minor/major versions*
bundle update
*
RAILS_ENV=production bundle exec rake db:migrate
*
service apache2 restart
Usually, the only problems you should get are with the plugins that may need to be updated.
I hope it helps
Hi thanks for this awesome post. Has definitely been a life saver.
I am trying to add my got repo on the localhost which is chown www-data but keep getting stderr: fatal: Not a git repository.
Do you know what I might be doing wrong?
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!!
Thank you Martin!
Hello Kevin,
” by “ ”
Thanks for the feedback!
1. To remove SSL support, run:
a2dissite redmine-redirect
edit: /etc/apache2/site-enabled/redmine.vhost
Replace “
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?
Cheers,
Incredibly simple guide to reach a clean install. Thanks a lot Martin!
Salut martin,
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.
If you a clue or any idea for me, i\’ll be gratefull !
Merci d\’avance
++
Hello Tony,
Maybe you are missing a statement such as
Allow from all
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
Hi Martin,
Did you try the new 3.2.0 version ?
Do you think it\’s possible to upgrade directly from 2.5.1 using you last recommendations ?
\”To sum up, how I do it is:
* Backup!
* svn update for revisions (2.5.1 -> 2.5.2)
* svn switch http://svn.redmine.org/redmine/branches/3.0-stable for minor/major versions
* bundle update
* RAILS_ENV=production bundle exec rake db:migrate
* service apache2 restart\”
Very late but yes, I did several updates like that. I didn’t experience a problem that I remember of except plugin compatibility.
Cheers!
Pingback: Redmine 2.5 installation guide on Debian Wheezy with MariaDB | SabrNET