It is assumed that we have a server with VirtualBox or VMWare installed.
1. Install Mercurial.Install the virtual machine
www.turnkeylinux.org/revision-control , assign the domain name sources.ourcompany.com to it. We start the virtual machine and make sure that it is available at the specified URL (
an example of a working server ).
2. Installing Redmine.Install the virtual machine
bitnami.org/stack/redmine , assign the domain name redmine.ourcopmany.com to it. By default, redmine will be available at redmine.ourcompany.com/redmine, which looks inelegant.
Edit /opt/bitnami/apps/redmine/conf/redmine.conf:
<VirtualHost *: 80>
ServerAdmin webmaster @ your_server_name
ServerName your_server_name.your_domain_name.local
ServerAlias your_server_name
# this not only blocks access to .svn directories, but makes it
# appear as though they aren’t
# forbidden
<DirectoryMatch "^ /. * / \. Svn /">
ErrorDocument 403 /404.html
Order allow, deny
Deny from all
Satisfy All
# This passes through remote_user to mongrel
RewriteEngine On
# Redirect non-static requests to cluster
RewriteCond% {DOCUMENT_ROOT} /% {REQUEST_FILENAME}! -F
RewriteRule ^ / (. *) $ Balancer: // redminecluster% {REQUEST_URI} [P, QSA, L]
')
ProxyPass / balancer: // redminecluster
ProxyPassReverse / balancer: // redminecluster
<Proxy balancer: // redminecluster>
BalancerMember
127.0.0.1 : 3001
BalancerMember
127.0.0.1 : 3002
and /opt/bitnami/apps/redmine/config/mongrel-cluster.yml:
log_file: log/mongrel.log
port: "3001"
environment: production
pid_file: tmp/pids/mongrel.pid
servers: 2
Restart the server - and the redmine will be available at redmine.ourcompany.com
3. Workflow.3.1. Adding a project to Mercurial.3.1.1. On sources.ourcompany.com in / srv / repos / hg we create a project folder (mkdir NewProject)
3.1.2. cd / srv / repos / hg / NewProject; hg init
3.1.3. ./hg/hgrc:
[web]
contact=admin@ourcompany.com
description = NewProject Description
name = NewProject
encoding=UTF-8
allow_push = developer1, developer2
3.1.4 Create a file with passwords for the project:
mkdir / srv / passwords; htpasswd -c / srv / passwords / NewProject developer1; htpasswd / srv / passwords / NewProject developer2;
3.1.5 /etc/apache2/conf.d/hg - add (and make the project completely private):
<Location /hg/NewProject>
Authtype Basic
AuthName "OurCompany NewProject"
AuthUserFile /srv/passwords/NewProject
Require valid-user
3.1.6 /etc/init.d/apache2 restart
3.1.7 chown -R MetraRail www-data
3.1.8 We are convinced of the availability of the project on sources.ourcompany.com and in the correct authentication.
3.2 Integration with redmine.3.2.1. sudo mkdir / var / repos / NewProject; cd / var / repos / NewProject; hg init
3.2.2. /var/repos/NewProject/.hg/hgrc
3.2.3.
[paths]
default = sources.ourcompany.com/hg/NewProject
[trusted]
users=root
[auth]
bb1.prefix= sources.ourcompany.com/hg/NewProject
bb1.username = developer1
bb1.password = password
3.2.4. Check
cd / var / repos / NewProject; hg pull -u
3.2.5. Add to crontab (to pull changes every minute):
sudo crontab -e, and add the line
* / 1 * * * * cd / var / repos / NewProject; hg pull -u / var / repos / NewProject
3.2.6. Set the link to / var / repos / NewProject in the project properties in redmine