Install Redmine with git and svn support over https on Debian wheezy using the Debian repository » History » Version 5

Jan Niggemann (redmine.org team member), 2014-06-11 21:07
Add out of support and security notice

1 1 Wim Bertels
h1. Install Redmine with git and svn support over https on Debian wheezy using the Debian repository
2 1 Wim Bertels
3 1 Wim Bertels
This a short (incomplete) howto for those who want to stay within the debian repository.
4 5 Jan Niggemann (redmine.org team member)
*%{color:red}IMPORTANT: The Debian package is v1.4.4. That version is out of support and has multiple security issues.%*
5 1 Wim Bertels
6 3 Wim Bertels
* Basic install using postgresql backend
7 1 Wim Bertels
_See references for configuration_
8 1 Wim Bertels
Redmine version 1.4.4 is present the debian repository.
9 1 Wim Bertels
<pre>
10 4 Fedir RYKHTIK
aptitude install postgresql redmine redmine-pgsql redmine-plugin-botsfilter
11 1 Wim Bertels
</pre>
12 1 Wim Bertels
13 3 Wim Bertels
* make sure all the necesarry modules for apache are loaded
14 1 Wim Bertels
_See references for configuration_
15 1 Wim Bertels
eg.
16 1 Wim Bertels
<pre>
17 1 Wim Bertels
aptitude install libdbd-pg-perl
18 1 Wim Bertels
</pre>
19 1 Wim Bertels
20 3 Wim Bertels
* set up the vhosts
21 1 Wim Bertels
_See references for configuration_
22 3 Wim Bertels
** svn, apache enabled site
23 2 Wim Bertels
in /etc/apache2/sites-enabled dir a site containing
24 2 Wim Bertels
<pre>
25 2 Wim Bertels
<VirtualHost *:443>
26 2 Wim Bertels
        ServerAdmin email@of.you
27 2 Wim Bertels
        DocumentRoot /var/www/redmine
28 2 Wim Bertels
        ServerName your.dns.org
29 2 Wim Bertels
30 2 Wim Bertels
        SSLEngine On
31 2 Wim Bertels
32 2 Wim Bertels
        SSLCertificateFile    /etc/apache2/ssl/yourcert.pem
33 2 Wim Bertels
        SSLCertificateKeyFile /etc/apache2/ssl/yourcert.key
34 2 Wim Bertels
        SSLCertificateChainFile /etc/apache2/ssl/yourcert.certificate_chain # optional, can be self signed
35 2 Wim Bertels
36 2 Wim Bertels
        <Directory /var/www/redmine>
37 2 Wim Bertels
                RailsBaseURI /
38 2 Wim Bertels
                PassengerResolveSymlinksInDocumentRoot on
39 2 Wim Bertels
                # http://httpd.apache.org/docs/current/misc/perf-tuning.html
40 2 Wim Bertels
                AllowOverride None
41 2 Wim Bertels
        </Directory>
42 2 Wim Bertels
43 2 Wim Bertels
        ErrorLog /var/log/apache2/error.log
44 2 Wim Bertels
45 2 Wim Bertels
        # Possible values include: debug, info, notice, warn, error, crit,
46 2 Wim Bertels
        # alert, emerg.
47 2 Wim Bertels
        LogLevel warn
48 2 Wim Bertels
49 2 Wim Bertels
        CustomLog /var/log/apache2/access.log combined
50 2 Wim Bertels
</VirtualHost>
51 2 Wim Bertels
</pre>
52 2 Wim Bertels
53 3 Wim Bertels
** in conf.d dir eg svn.conf
54 2 Wim Bertels
<pre>
55 2 Wim Bertels
# /svn location for users
56 2 Wim Bertels
PerlLoadModule Apache::Redmine
57 2 Wim Bertels
<Location /svn>
58 2 Wim Bertels
    DAV svn
59 2 Wim Bertels
    SVNParentPath "/var/svn" 
60 2 Wim Bertels
    Order deny,allow
61 2 Wim Bertels
    Deny from all
62 2 Wim Bertels
    Satisfy any
63 2 Wim Bertels
64 2 Wim Bertels
    PerlAccessHandler Apache::Authn::Redmine::access_handler
65 2 Wim Bertels
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler
66 2 Wim Bertels
    AuthType Basic
67 2 Wim Bertels
    AuthName "Projectwerk Subversion Repository" 
68 2 Wim Bertels
69 2 Wim Bertels
    #read-only access    
70 2 Wim Bertels
    <Limit GET PROPFIND OPTIONS REPORT>
71 2 Wim Bertels
        Require valid-user
72 2 Wim Bertels
        # Allow from [my server ip]
73 2 Wim Bertels
        Allow from putyourserver.ipadress
74 2 Wim Bertels
        Allow from 127.0.0.1
75 2 Wim Bertels
        # Allow from another-ip
76 2 Wim Bertels
        Satisfy any
77 2 Wim Bertels
    </Limit>
78 2 Wim Bertels
    # write access
79 2 Wim Bertels
    <LimitExcept GET PROPFIND OPTIONS REPORT>
80 2 Wim Bertels
        Require valid-user
81 2 Wim Bertels
    </LimitExcept>
82 2 Wim Bertels
    ErrorDocument 404 default
83 2 Wim Bertels
84 2 Wim Bertels
    # postgresqlconnection
85 2 Wim Bertels
    RedmineDSN "DBI:Pg:dbname=redmine_default;host=localhost" 
86 2 Wim Bertels
    RedmineDbUser "redmine" 
87 2 Wim Bertels
    RedmineDbPass "geheim"
88 2 Wim Bertels
</Location>
89 2 Wim Bertels
</pre>
90 2 Wim Bertels
91 3 Wim Bertels
** git
92 1 Wim Bertels
93 2 Wim Bertels
in conf.d dir a git.conf file
94 2 Wim Bertels
<pre>
95 2 Wim Bertels
PerlLoadModule Apache::Redmine
96 2 Wim Bertels
97 2 Wim Bertels
SetEnv GIT_PROJECT_ROOT /var/git/
98 2 Wim Bertels
SetEnv GIT_HTTP_EXPORT_ALL
99 2 Wim Bertels
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
100 2 Wim Bertels
101 2 Wim Bertels
<Location /git>
102 2 Wim Bertels
  AuthType Basic
103 2 Wim Bertels
  Require valid-user
104 2 Wim Bertels
  AuthName "Projectwerk Git Repository"
105 2 Wim Bertels
106 2 Wim Bertels
  PerlAccessHandler Apache::Authn::Redmine::access_handler
107 2 Wim Bertels
  PerlAuthenHandler Apache::Authn::Redmine::authen_handler
108 2 Wim Bertels
 
109 2 Wim Bertels
  # postgresqlconnectie leggen
110 1 Wim Bertels
  RedmineDSN "DBI:Pg:dbname=redmine_default;host=localhost"
111 1 Wim Bertels
  RedmineDbUser "redmine"
112 1 Wim Bertels
  RedmineDbPass "geheim"
113 2 Wim Bertels
</Location>
114 2 Wim Bertels
</pre>
115 2 Wim Bertels
116 3 Wim Bertels
don't forget to restart apache
117 3 Wim Bertels
118 3 Wim Bertels
* set up cron repository creation
119 2 Wim Bertels
_See references for configuration_
120 3 Wim Bertels
** choose either only svn or git (one can only be the master repo)
121 3 Wim Bertels
** if you want both u will need to register the second repo (git or svn) by hand on the redmine project site, for that you also need to make you use force.
122 2 Wim Bertels
<pre>
123 2 Wim Bertels
eg
124 2 Wim Bertels
*/5 * * * * root ruby /usr/share/redmine/extra/svn/reposman.rb --redmine localhost --scm Subversion --svn-dir /var/svn --owner www-data --url file:///var/svn --key=ARAZERAEZRZAER >> /var/log/redmine/reposman.log
125 2 Wim Bertels
*/30 * * * * root ruby /usr/share/redmine/extra/svn/reposman.rb -r localhost --scm Git --svn-dir /var/git --owner www-data --url /var/git --key=ARAZRRAEZRAEZRAEZ --verbose -f >> /var/log/redmine/reposman.log
126 1 Wim Bertels
</pre>
127 2 Wim Bertels
128 3 Wim Bertels
* svn repo appear after enabling repository module on the site,
129 2 Wim Bertels
if u also have the git cron added, then u can add the git repo manually,
130 1 Wim Bertels
redmine will complain, but it exists. So checkout the git repo, add a file, commit and push to server, redmine will no longer complain.
131 1 Wim Bertels
132 1 Wim Bertels
References:
133 1 Wim Bertels
http://www.redmine.org/issues/4905
134 1 Wim Bertels
http://www.redmine.org/issues/3958
135 1 Wim Bertels
https://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.html
136 1 Wim Bertels
http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_using_Debian_package
137 1 Wim Bertels
http://www.redmine.org/projects/redmine/wiki/HowToInstallRedmineOnUbuntuServer