Project

General

Profile

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

Fedir RYKHTIK, 2014-06-10 22:20

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 3 Wim Bertels
* Basic install using postgresql backend
6 1 Wim Bertels
_See references for configuration_
7
Redmine version 1.4.4 is present the debian repository.
8
<pre>
9 4 Fedir RYKHTIK
aptitude install postgresql redmine redmine-pgsql redmine-plugin-botsfilter
10 1 Wim Bertels
</pre>
11
12 3 Wim Bertels
* make sure all the necesarry modules for apache are loaded
13 1 Wim Bertels
_See references for configuration_
14
eg.
15
<pre>
16
aptitude install libdbd-pg-perl
17
</pre>
18
19 3 Wim Bertels
* set up the vhosts
20 1 Wim Bertels
_See references for configuration_
21 3 Wim Bertels
** svn, apache enabled site
22 2 Wim Bertels
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 3 Wim Bertels
** in conf.d dir eg svn.conf
53 2 Wim Bertels
<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 3 Wim Bertels
** git
91 1 Wim Bertels
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 1 Wim Bertels
  RedmineDSN "DBI:Pg:dbname=redmine_default;host=localhost"
110
  RedmineDbUser "redmine"
111
  RedmineDbPass "geheim"
112 2 Wim Bertels
</Location>
113
</pre>
114
115 3 Wim Bertels
don't forget to restart apache
116
117
* set up cron repository creation
118 2 Wim Bertels
_See references for configuration_
119 3 Wim Bertels
** choose either only svn or git (one can only be the master repo)
120
** 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.
121 2 Wim Bertels
<pre>
122
eg
123
*/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
124
*/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
125 1 Wim Bertels
</pre>
126 2 Wim Bertels
127 3 Wim Bertels
* svn repo appear after enabling repository module on the site,
128 2 Wim Bertels
if u also have the git cron added, then u can add the git repo manually,
129 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.
130
131
References:
132
http://www.redmine.org/issues/4905
133
http://www.redmine.org/issues/3958
134
https://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.html
135
http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_using_Debian_package
136
http://www.redmine.org/projects/redmine/wiki/HowToInstallRedmineOnUbuntuServer