HowTo Install Redmine on Debian 9 » History » Version 5

Version 4 (Bruce Schaller, 2017-12-29 23:42) → Version 5/8 (Fabián Rodríguez, 2018-07-19 16:30)

h1. How to Install Redmine on Debian 9 (Stretch)

h2. Installing from I was having some trouble installing redmine because I am not an experienced Debian packages

Official Redmine packages are available for Debian. As of July 2018, stable version 3.3.1 is supported
administrator! I used the talking points in Debian 9.

If you will be using Redmine in a production environment requiring long term support
several other guides and stability using official packages is recommended. You will be receiving automatic feature and security updates.

See "the Redmine documentation on the Debian Wiki":https://wiki.debian.org/Redmine for detailed instructions.

h2. Installing from sources

If you want the very latest Redmine version and are comfortable doing manual upgrades and system administration, the following steps will guide you through installing Redmine from sources.

some googling to get these instructions together.

1. Install the pre-requisites for Redmine redmine and all its packages.

<pre>
sudo
&gt; apt install gcc build-essential zlib1g zlib1g-dev zlibc ruby-zip libssl-dev libyaml-dev \
libcurl4-openssl-dev ruby gem libapache2-mod-passenger apache2 apache2-dev libapr1-dev \
libxslt1-dev checkinstall libxml2-dev ruby-dev vim libmagickwand-dev imagemagick sudo rails
</pre>

&gt;
2. Install your database of choice.

<pre>
If installing another database, it&#x27;s very easy! Just follow the instructions here instead:

&gt;
apt install postgresql
</pre>


3. If installing Postgres, postgres, install dev. Use the version number installed in the previous step.

<pre>
&gt; apt install postgresql-server-dev-9.6
</pre>
postgresql-server-dev-* (See version in step 2 during install)

4. Choose a directory where to install Redmine. redmine. In this example /opt used. I used /opt. You can use another location, wherever you like, but you will need to update the following steps as necessary based on your choice. desired install location.

Install Redmine redmine in /opt

<pre>
&gt; cd /opt


&gt;
mkdir redmine


&gt;
cd redmine
</pre>


Get Redmine redmine - use the "download":http://www.redmine.org/projects/redmine/wiki/Download download page and review the functionality that you need to determine the right version for you.

<pre>
I wanted DMSF, which is not yet compatible with the latest version. If in doubt, check it out!

&gt;
wget http://www.redmine.org/releases/redmine-3.4.6.tar.gz
</pre>
http://www.redmine.org/releases/redmine-3.3.4.tar.gz

Unpack
<pre>
&gt; tar xzf ./redmine-3.4.6.tar.gz
</pre>
./redmine-3.3.4.tar.gz

5. Login as the default postgres user and create a new role and database. Use your own password.

<pre>
password )).
&gt; sudo -u postgres psql postgres


&gt;
CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'your_password' NOINHERIT VALID UNTIL 'infinity';


&gt;
CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
</pre>


then press CTRL-D to escape the shell.

edit @/etc/postgresql/9.6/main/pg_hba.conf@ /etc/postgresql/9.6/main/pg_hba.conf and set Postgres postgres to trust :

<pre>
&gt; "local all postgres trust "
&gt; sudo service postgresql reload
</pre>



6. Create the @/opt/redmine/redmine-3.4.6/config/database.yml@ /opt/redmine/redmine-3.3.4/config/database.yml file with the following contents…

<pre> &gt; production:
production:
&gt; &gt; adapter: postgresql

&gt; &gt;
database: redmine

&gt; &gt;
host: localhost

&gt; &gt;
username: redmine

&gt; &gt;
password: your_password
</pre>

&gt;
Note that the spacing is important in this file. Under file! under the “Production” line, each other line must be indented by two spaces, not tabs. Replace your_password with the password specified above. Remember Seriously, don’t use your_password…. Remeber to save. save! Keep in mind ALSO- Postgresql passwords password can't start with @ character (or other non alpha numerics). numerics?) .

7. Next, set up the database schema and load the initial database.

<pre>
&gt; bundle install


&gt;
bundle exec rake generate_secret_token


&gt;
RAILS_ENV=production bundle exec rake db:migrate


&gt;
RAILS_ENV=production bundle exec rake redmine:load_default_data
</pre>


8.Do a quick test to verify that redmine is working using webrick.

<pre>
&gt; bundle exec ruby /usr/bin/rails server -b your_ip webrick -e production
</pre>


Now And try to connect via browser to @http://your_ip:3000@. your ip:3000. Webrick is not for production systems. It is a good way to check things before getting started with Apache, though.

9. Next, let’s set up Apache.

<pre>
&gt; cd /opt/


&gt;
sudo chown -R www-data:www-data /opt/redmine


&gt;
cd /opt/redmine/redmine-3.4.6
/opt/redmine/redmine-3.3.4

&gt;
sudo chmod -R 755 files log tmp public/plugin_assets


&gt;
sudo chown www-data:www-data Gemfile.lock
</pre>


9.1 Create a symbolic link which points from the Apache working directory of apache to the Redmine redmine public folder folder…

<pre>
&gt; sudo ln -s /opt/redmine/redmine-3.4.6/public/ /opt/redmine/redmine-3.3.4/public/ /var/www/html/redmine
</pre>


9.2 Create Need to create a new vhost configuration configuration…

<pre>
&gt; sudo nano /etc/apache2/sites-available/master.conf
</pre>


and paste in: in….

<pre>
&gt; <VirtualHost *:80>


&gt;
&gt;
ServerAdmin admin@example.com
&gt; Servername hostname
&gt; DocumentRoot /var/www/html/


&gt;
&gt;
<Location /redmine>
&gt; RailsEnv production
&gt; RackBaseURI /redmine
&gt; Options -MultiViews
&gt; </Location>


&gt;
&gt;
</VirtualHost>

</pre>

Then, run: run….

<pre>
&gt; sudo a2dissite 000-default.conf


&gt;
sudo a2ensite master.conf
</pre>


9.3 add this line to @/etc/apache2/mods-available/passenger.conf@ /etc/apache2/mods-available/passenger.conf…. in the body of the document- not just the 1st line.

<pre>
&gt; PassengerUser www-data
</pre>


Restart the Apache web server: run…

<pre>
&gt; sudo service apache2 restart
</pre>


10. Open your browser and navigate to: @http://your-ip-address/redmine@. http://your-ip-address/redmine

And hopefully, you're up and running.

Sources:
* [[HowTo Install Redmine on Debian 8 with Apache2-Passenger|Redmine with Apache and MySQL on Debian 8 jessie]]