Author Topic: [SOLVED] Good setup for Zentyal + Redmine  (Read 10552 times)

jgggr

  • Zen Apprentice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
[SOLVED] Good setup for Zentyal + Redmine
« on: January 04, 2011, 03:28:39 pm »
Hi there.

I'm using Zentyal fresh installed from the iso on my server. I currrently use almost all of its features ( (PDC, file sharing, network infrastructure (gateway, firewall, dns, dhcp for lan), webserver, ftp access and planning to use vpn). I don't use webmail and zarafa.

I intend to install Redmine on the same server. I've tested Redmine on a virutal machine using bitnami stack (http://bitnami.org/stack/redmine). I've read on this forum that installing redmine directly with Zentyal might not be a very simple task.
I think using the virtual machine is a very straightforward and simple implementation for a newbie like me.


My question is: what would be the better setup?
1 - Would it be possible to install redmine on a virtual machine over Zentyal?
2 - Should I start all over again and do a fresh ubuntu server install than install 2 virtual machines: zentyal + redmine?
3 - Should I give up of virtual machines and just install redmine over zentyal?

P.S.: I'm changing the topic to [SOLVED] because I've installed redmine (option 3 above: redmine and zentyal peacefully - so far - living together). I made a kind of a HOW-TO and posted below.
« Last Edit: January 31, 2011, 08:01:30 pm by jgggr »

jgggr

  • Zen Apprentice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Good setup for Zentyal + Redmine
« Reply #1 on: January 05, 2011, 02:27:11 pm »
Has anyone ever needed to combine this two in a server? Please help!

jsalamero

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1419
  • Karma: +45/-1
    • View Profile
Re: Good setup for Zentyal + Redmine
« Reply #2 on: January 07, 2011, 04:44:48 pm »
There is no incompatibility between Redmine and Zentyal, just follow the usual procedure to install it on Ubuntu Lucid.

binary-two

  • Zen Monk
  • **
  • Posts: 61
  • Karma: +3/-0
    • View Profile
Re: Good setup for Zentyal + Redmine
« Reply #3 on: January 07, 2011, 05:28:24 pm »
Hi jgggr,

Redmine works perfectly fine on a standard Ubuntu/Zentyal installation.

I followed the instructions on redmine.org [1], 'Ubuntu 10.04 using Passenger' (i.e., Apache + mod_passenger). There is an additional link at the bottom of the page [2]. I think that you can just adjust several things using the GUI rather the config files. I just quickly compiled some things I thought they could be relevant out of my head here.

The best thing IMHO is that redmine supports LDAP authentication out of the box (Administration/Settings/Authentication/LDAP authentication, right bottom corner).

For a standard Zentyal configuration, the entries should look like:

Code: [Select]
Name ldap (does not really matter)
Host localhost
Port 389
Account cn=ebox,dc=ebox (check your Zentyal-LDAP-settings under Users and Groups in case the domain is different)
Base DN ou=Users,dc=ebox (like mentioned above)
On-the-fly user creation check if you like to have all users
Login uid
Firstname givenName
Lastname sN
Email mail

Following the howtos mentioned above,

/etc/redmine/defaultdatabase.yml should look somehow like this:

Code: [Select]
production:
  adapter: mysql
  database: redmine_default
  host: localhost
  port:
  username: redmine
  password: ${yourmysqluserpassword}
  encoding: utf8

For outgoing email, you can add a user in Zentyal and email.yml should look somehow like this:

Code: [Select]
production:
  delivery_method: :smtp
  smtp_settings:
    tls: true
    enable_starttls_auto: true
    address: localhost
    port: 25
    domain: ${yourdomain}
    authentication: :login
    user_name: redmine@${yourdomain}
    password: ${yourzentyaluserpassword}

To receive email you can use following cron job [3], /etc/cron.d:

Code: [Select]
5,15,25,35,45,55 * * * * root [ -x /usr/share/redmine/cron/email-receive.sh ] && /usr/share/redmine/cron/email-receive.sh

I've put the actual file under /usr/share/redmine/cron/email-receive.sh, but thats just my configuration:

Code: [Select]
#!/bin/bash
export PATH=$PATH:/usr/local/rubygems/bin:/usr/local/rubygems/gems/bin
export RUBYLIB=/usr/local/rubygems/lib
export GEM_HOME=/usr/local/rubygems/gems
cd /var/www/redmine
RAILS_ENV="production" \
  rake --silent redmine:email:receive_imap \
  port=993 host=localhost username=redmine@${yourdomain} password={yourzentyaluserpassword} ssl=1

I hope I was able to help. The howtos are well written and pretty straight forward. The guys did really a good job. If you need anything else, just browse the redmine.org website or post anything Zentyal specific question here.

So long,

Björn

[1] http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Ubuntu
[2] http://www.techrecipes.net/web/redmine/install-in-ubuntu
[3] http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails

jgggr

  • Zen Apprentice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Good setup for Zentyal + Redmine
« Reply #4 on: January 21, 2011, 01:53:10 pm »
Hello. Thank you for sharing these informations.
I've succesfully installed redmine in my Zentyal box using these howto.

I have yet one task, that I really can't get done! Let's see if you can help me.

I want redmine to be accessed via: redmine.mydomain.com

I created the virtual host and I've tried a lot of different configurations, but it just doesn't seem to work.
This is how i think it should work:
1) I´ve modified the standard /etc/apache2/sites-availabe/ebox-redmine.mydomain.com to include this:
Code: [Select]
<VirtualHost *:80>
        ServerAdmin webmaster@granserver

        ServerName redmine.mydomain.com
        DocumentRoot /srv/www/redmine.mydomain.com
 
       #this is the only line I've added:
        RailsBaseURI /

        ErrorLog /var/log/apache2/redmine.mydomain.com-error.log
        CustomLog /var/log/apache2/redmine.mydomain.com-access.log combined

        # Custom configuration goes in this file
        Include /etc/apache2/sites-available/user-ebox-redmine.mydomain.com/*
</VirtualHost>

2) I created the symlink for redmine
Code: [Select]
sudo rmdir /srv/www/redmine.mydomain.com
sudo ln -s /usr/share/redmine/public /srv/www/redmine.mydomain.com

3) restarted apache
Code: [Select]
sudo apache2ctl restart
But I've got no luck!! If I make the symlink inside my root folder and the make the RailsBaseURI point to that it works (but then I got something like: redmine.mydomain.com/redmine, which is redundant and not elegant!)

I've also tried a lot of different combinations (changing the document root, the railsbaseuri and so on) but with no success.

I've also tried to insert this code on my config file:
Code: [Select]
       <Directory /srv/www/redmine.mydomain.com>
               Options FollowSymLinks
               AllowOverride None
               Order allow,deny
               Allow from all
       </Directory>

But when I do it, I get a Forbidden error message (You don't have permission to access / on this server.)

Anyone done it? Please help!!
« Last Edit: January 21, 2011, 01:55:50 pm by jgggr »

jgggr

  • Zen Apprentice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Good setup for Zentyal + Redmine
« Reply #5 on: January 21, 2011, 06:55:17 pm »
In the process of trying to get this done, I've realised that through the howto (apt-get) method I end up with redmine 0.9, but there is a stable 1.1 version. So I've upgraded it following the instructions on this page.
http://www.knowledgement.ie/technical/servers/upgrade-redmine-from-0-9-3-to-1-0-5

(The only problem there is that it forgets to tell you that you must delete or rename .htaccess file in the public directory of redmine)

Also, I've now accomplished to get redmine accessed by redmine.mydomain.com
I´ve added the following line to my apache conf file:
Code: [Select]
PassengerAppRoot /usr/share/redmine-1.1.0
Now, my only problem is that I still cannot access this site from outside my network. I have Zentyal configured with dynamicDNS for Joker.com, my DNS provider.

At Joker.com I've created a NS record for redmine.mydomain.com to look at mydomain.com
I've DNS module up at Zentyal and added mydomain.com to its domain
I've added redmine as hostname for mydomain.com
I've opened the firewall for DNS requests

When I try to open the site from outside network, I get timed out... Any ideas?

Svein Wisnaes

  • Zen Samurai
  • ****
  • Posts: 325
  • Karma: +5/-0
  • A Norwegian living in Brazil
    • View Profile
    • Oceanwatcher Media | Svein Wisnaes
Re: Good setup for Zentyal + Redmine
« Reply #6 on: January 28, 2011, 01:49:49 am »
There is no incompatibility between Redmine and Zentyal, just follow the usual procedure to install it on Ubuntu Lucid.

I would love to see a module for Zentyal that give us a one click install of Redmine and a few other applications. But Redmine alone would be a great start :-)
Regards,

Oceanwatcher
Do NOT use PM for support. This is a community forum and support is not on a one-on-one basis.
READ BEFORE POSTING - How to make a good post - click here

jgggr

  • Zen Apprentice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Good setup for Zentyal + Redmine
« Reply #7 on: January 31, 2011, 07:59:16 pm »
Hello! Thank you very much for those who helped, I have now succesfully installed redmine on Zentyal. This is how to:

1. Enable webserver
Enable Zentyal web server. Open Firewall for http access. Forward 80 port from router to zentyal.

2. Install redmine
* for detailed instructions see the links on the posts above (thank you for that)

- backup, just in case:
/usr/share/ebox-ebackup ./ebox-remote-ebackup --incremental

- install mysql-server and redmine packages
sudo apt-get install mysql-server redmine redmine-mysql subversion
-- you'll be asked for root password for mysql
-- you'll be asked to config redmine access to mysql
Code: [Select]
yes para dbconfig-common
db: mysql
root pass: somepassword
redmine db pass: otherpassword

3. upgrade redmine

* The method above unfortanatelly will install an old version of redmine (0.9) so we must upgrade it. I've done this on a trial and error basis, reading a lot of stuff on the web. Here are the steps I've done, but may not all be necessary for you.

- download it
cd /usr/share
sudo wget http://path.to/redmine-1.1.0.tar.gz
tar -xvf redmine-1.1.0.tar.gz
rm redmine-1.1.0.tar.gz


- install some necessary stuff
* If you're installing the same version as I (1.1.0) you're safe with the versions of the softwares below. If not, checkout redmine webpage for compatibilies.
sudo apt-get install rails -v=2.3.5
sudo gem install rack -v=1.0.1
sudo gem install -v=0.4.2 i18n


- generate some crazy session secret
udo rake generate_session_secret


- migrate DB (from the old to the new one)
sudo rake db:migrate RAILS_ENV=production


- copy the files from old (0.9) to new installation (1.1.0) This is only necessary if you were running redmine before upgrade.
sudo cp /var/lib/redmine/default/files/* /usr/share/redmine-1.1.0/files


- clean up things
sudo rake tmp:cache:clear
sudo rake tmp:sessions:clear


- remove (or rename) .htaccess file
* I've failed to get redmine running while this file was there. Very important step!
d /usr/share/redmine-1.1.0/public/.htaccess
   mv .htaccess htcrazy


* Now there are 2 steps that I've done in my trial and error efforts that I don't know if they are really necessary. If you do, please tell me!
- Change some permissions
sudo chmod 644 /usr/share/redmine-1.1.0/config/settings.yml
sudo chmod 644 /usr/share/redmine-1.1.0/config/database.yml
sudo chmod 644 /usr/share/redmine-1.1.0/config/email.yml


- change some owners
mkdir tmp public/plugin_assets
sudo chown -R www-data:www-data files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets


4. Config webserver for running redmine
* This is an example if you want to have redmine running on a subdomain like:
http://redmine.mydomain.com

- Access zentyal web page and do the following:
- infra > web server > add virtual host: mydomain.com
- infra > web server > add virtual host: redmine.mydomain.com
- infra > DNS > add domain: mydomain.com
- add hostname: redmine ip: 10.0.1.1
- add nameserver: redmine

The files for the recently created virtual host will be at:
/srv/www/redmine.mydomai.com


- Create symlink
cd /srv/www/redmine.mydomain.com
sudo ln -s /usr/share/redmine-1.1.0/public redmine


- Config apache. Create config file for redmine
cd /etc/apache2/sites-available/user-ebox-redmine.mydomain.com
sudo vi redmine.conf


Edit with the following:
Code: [Select]
DocumentRoot /srv/www/redmine.mydomain.com/redmine

        <Directory /srv/www/redmine.mydomain.com>
                Options FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>

       # RailsEnv production
        PassengerAppRoot /usr/share/redmine-1.1.0/
        RailsBaseURI /redmine

- Edit passagenr.conf
sudo vi /etc/apache2/mods-available/passanger.conf

Include the following line:
Code: [Select]
PassengerDefaultUser www-data

- restart apache
sudo apache2ctl restart


5. Config DNS server
Config your DNS server (not zentyal, but your provider - mine is Joker.com) so that redmine.mydomain.com points to mydomain.com
The way I did was creating a CNAME record for that (it's working for now)

6. Config redmine

- Access it via
http://redmine.mydomain.com
user: admin
password: admin


- change you password

- Config to access your zentyal LDAP server (settings > authentication > LDAP settings):
Code: [Select]
- nome: ldap
- servidor: localhost
- porta: 389
- conta: (blank)
- senha: (blank)
- DN base: dc=yourzentyalhostname
- criar usuario on-the-fly: yes! (check it)
- usuario: uid
- nome: givenName
- sobrenome: sn
- email: mail

- Config redmine to send emails. Go back to shell
sudo vi /usr/share/redmine-1.1.0/config/email.yml

Edit to best fit your email configuration. I don't use zentyal as mail server so my config is something like this:

Code: [Select]
production:
  smtp_settings:
     address: "smtp.myotherdomain.com"
     port: 25
     authentication: :login
     domain: 'myotherdomain.com'
     user_name: 'redmine@myotherdomain.com'
     password: '123456'

- restart redmine
* Every how-to of redmine tells you you must restart redmine, but don't tell you how to do it! This is how I think it's done:
sudo touch /usr/share/redmine-1.1.0/tmp/restart.txt

I'm not sure if this really restarts redmine, but I know that my redmine is sending emails just fine :)

7. Config redmine backup
I'm inspired by this:
http://forum.zentyal.org/index.php?topic=5854.0

7.1 database
- create a script to run the backup
sudo vi scripts/backupredmine


Should look like this:
Code: [Select]
#!/bin/bash

BDIR=/backup
BFILE=redmine.dump.gz
OFILE=$BDIR/$BFILE

if [ ! -d $BDIR ]; then
   mkdir $BDIR
fi

if [ -f $OFILE ]; then
   rm $OFILE
fi

echo Backup database
DATABASE=`grep "database:" /usr/share/redmine-1.1.0/config/database.yml | awk '{print $2}'`
USERNAME=`grep "username:" /usr/share/redmine-1.1.0/config/database.yml | awk '{print $2}'`
PASSWORD=`grep "password:" /usr/share/redmine-1.1.0/config/database.yml | awk '{print $2}'`

/usr/bin/mysqldump --single-transaction -u$USERNAME -p$PASSWORD $DATABASE | gzip --best >$OFILE
This script will read your database configuration to check username and password and backup it up on gz file at dir /backup.

- make it runnable
sudo chmod +x backupredmine

- Now we want to run this script every time zentyal does the automatic backup.
cd /etc/ebox/hooks
       cp template.postservice ebackup.postservice
       vi ebackup.postservice


Edit it to:
Code: [Select]
if [ $1 = "1" ]; then
   if [ -f /scripts/backupredmine ]; then
      sed 's_/usr/share/ebox-ebackup/ebox-remote-ebackup_/scripts/backupredmine \&\& /usr/share/ebox-ebackup/ebox-remote-ebackup_' </etc/cron.d/ebox-ebackup >/tmp/ebox.backup.mod
      cp /tmp/ebox.backup.mod /etc/cron.d/ebox-ebackup
      rm /tmp/ebox.backup.mod
   fi
fi

- Now include this two folder on your zentyal backup:
/backup
/scripts

7.2 files
Just include this folder on your zentyal backup:
/usr/share/redmine-1.1.0/files


8. Installing plugins
If you want to install plugins you would probably need git
sudo apt-get install git-core

So now you can do on redmine home path:
script/plugin install git://path.to/somecoolplugin.git
* Some plugins will require you to migrate db and other stuff, just read their how-to. I've just liked to point out the install git-core step because I didn't see it on any how-to but I found it necessary.

Welll that's it, I guess. Sorry for typos and errors. If you see some error, please do comment!



Svein Wisnaes

  • Zen Samurai
  • ****
  • Posts: 325
  • Karma: +5/-0
  • A Norwegian living in Brazil
    • View Profile
    • Oceanwatcher Media | Svein Wisnaes
Re: [SOLVED] Good setup for Zentyal + Redmine
« Reply #8 on: February 01, 2011, 03:28:03 am »
Wow! That is a very good write-up!

It is also a great argument for getting a Redmine module for Zentyal! There are countless opportunities in this process to go seriously wrong and mess up your server so you have to start by re-installing your server again...

Zentyal team: Please make a Redmine module! It would be good for a lot more than program development.
Regards,

Oceanwatcher
Do NOT use PM for support. This is a community forum and support is not on a one-on-one basis.
READ BEFORE POSTING - How to make a good post - click here

nicolasdiogo

  • Forum Moderator
  • Zen Samurai
  • *****
  • Posts: 263
  • Karma: +3/-0
  • a pessimist, but trying out optimism
    • View Profile
    • BrainPowered Business Intelligence Consultancy - UK
Re: [SOLVED] Good setup for Zentyal + Redmine
« Reply #9 on: October 11, 2011, 06:18:13 pm »
just to add that (at least for me) there was no need for adding details on redmine for account and password (to connect).
my opinions and suggestion expressed on this forum are my own as a user.
please note that i am not part of the Zentyal Development Team

www.brainpowered.net - supporting open-source Business Intelligence in Europe

apos

  • Zen Apprentice
  • *
  • Posts: 19
  • Karma: +2/-0
    • View Profile
Zentyal 3.2 + Redmine 2.3.3 + LDAP
« Reply #10 on: November 02, 2013, 10:41:11 am »
For all, that had been driven crazy with ths problem like me in Zentyal 3.2 and Redmine 2.3*:

  • Port changed from 389 to 390
  • Firewall is not open for port 390 (you have to open it manually)
  • Use zentyal readonly account

https://wiki.blue-it.org/Zentyal#LDAP
« Last Edit: November 02, 2013, 10:44:37 am by apos »

robb

  • Guest
Re: [SOLVED] Good setup for Zentyal + Redmine
« Reply #11 on: November 02, 2013, 03:50:57 pm »
Thanks for the update (and the link to the wiki)