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

Wim Bertels, 2013-07-05 17:36

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