Project

General

Profile

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

Wim Bertels, 2013-07-05 17:34

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