Sunday, November 2, 2014

Ubuntu 10.04 or 12.04 using Passenger Installing Redmine

Ubuntu 10.04 or 12.04 using Passenger Installing Redmine

Step-by-step for Ubuntu 12.04

A step-by-step guide to getting Redmine running on a fresh installation of Ubuntu.

Ubuntu 10.04 or 12.04 using Passenger

The installation assumes that the web server and database are already in place, so you probably want to install the LAMP stack first if you don't already have it:
$ sudo tasksel install lamp-server
You will also need to install the Passenger apache module.
$ sudo apt-get install libapache2-mod-passenger
Also, the default AppArmor configuration can get in the way, so you may need to set the mysqld profile to complain:
$ sudo aa-complain /usr/sbin/mysqld

Installing Redmine 0.9.3 (Ubuntu 10.04) or Redmine 1.3.2 (Ubuntu 12.04)

As of 10.04 and 12.04, Redmine is available through Ubuntu's package manager, and installation is simple:
$ sudo apt-get install redmine redmine-mysql
The second package, redmine-mysql, can be replaced by either redmine-pgsql or redmine-sqlite if you want to use either of those databases.
The installation process should prompt you for all the interesting details.
Redmine will now be installed in /usr/share/redmine and /etc/redmine

Installing the latest Redmine

The package with Ubuntu 10.04 is stuck in the 0.9.x branch and Ubuntu 12.04 is stuck in the 1.3.x branch. A PPA exists that has the latest branch here: https://launchpad.net/~ondrej/+archive/redmine
To install redmine using the PPA:


Add this to  /etc/apt/sources.list

deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse

$ sudo add-apt-repository ppa:ondrej/redmine
$ sudo apt-get update
$ sudo apt-get install redmine redmine-mysql
Note: If your server is behind a firewall, you will need to export your firewall settings before running add-apt-repository. Otherwise, the command will hang.
Run the following
export http_proxy="http://proxy.your.server:port" and export https_proxy="http:proxy.your.server:port".

Configuration

Symlink /usr/share/redmine/public to your desired web-accessible location. E.g.:
$ sudo ln -s /usr/share/redmine/public /var/www/redmine
By default, passenger runs as 'nobody', so you'll need to fix that. In /etc/apache2/mods-available/passenger.conf, add:
PassengerDefaultUser www-data
You'll also need to configure the /var/www/redmine location in /etc/apache2/sites-available/default by adding:
redmine
> RailsBaseURI /redmine PassengerResolveSymlinksInDocu
mentRoot on If you set your AppArmor mysqld profile to complain you ought to set it back to enforce:
$ sudo aa-enforce /usr/sbin/mysqld
Enable passenger:
$ sudo a2enmod passenger
Restart apache2
$ sudo service apache2 restart
and you should be able to access Redmine at: http://redmine.server.ip.address/redmine
If you receive a "403: Forbidden" error after setting up Redmine, the Redmine 'public' folder may have incorrect permissions set. The executable bit on the public folder must be enabled or you will receive a "403: Forbidden" error when attempting to access Redmine.

$ sudo chmod a+x /usr/share/redmine/public

Script for install Redmine on Ubuntu:

 Save as redmine.sh

# Shell Script
# Installed Redmine On UBUNTU

apt-get -y install apache2 libapache2-mod-passenger
apt-get -y install mysql-server mysql-client
apt-get -y install redmine redmine-mysql


mv /etc/apache2/mods-available/passenger.conf /etc/apache2/mods-available/passenger.conf_ori
echo -e; awk 'NR==2{print "PassengerDefaultUser www-data"}1' /etc/apache2/mods-available/passenger.conf_ori >> /etc/apache2/mods-available/passenger.conf
ln -s /usr/share/redmine/public /var/www/redmine
chown -R www-data:www-data /var/www/redmine

#echo -e  '   >>   /etc/apache2/sites-available/default
#echo -e      RailsBaseURI /redmine    >>   /etc/apache2/sites-available/default
#echo -e      PassengerResolveSymlinksInDocumentRoot on   >>   /etc/apache2/sites-available/default
#echo -e  '  >>   /etc/apache2/sites-available/default

echo "RailsBaseURI /redmine" > /etc/apache2/sites-available/redmine
a2ensite redmine
/etc/init.d/apache2 reload
service apache2 restart

apt-get -y install rsync


#touch /etc/cron.daily/redmine
# echo Enter Your mysql Root Password
#read passwd
#!/bin/sh
# To Take Redmine Backup
#/usr/bin/mysqldump -u root -p$passwd redmine_default | gzip > /backups/redmine_db_`date +%y_%m_%d`.gz
#rsync -a /var/lib/redmine/default/files /backups/files

apt-get install postfix
mkdir -p /etc/redmine/default
touch /etc/redmine/default/configuration.yml
echo -e production:  >> /etc/redmine/default/configuration.yml
echo -e   email_delivery: >> /etc/redmine/default/configuration.yml
echo -e     delivery_method: :sendmail >> /etc/redmine/default/configuration.yml

service apache2 restart
echo " "
echo " "
echo "###################################################################"
echo " "
fo=$(ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}')
echo YOUR REDMINE URL : http://$fo/redmine
echo "  "
echo "User Name : admin"
echo "Password  : admin"
echo " "
echo "####################################################################"

echo REDMINE SUCCESSFULLY INSTALLED YOUR UBUNTU SERVER
echo THANK YOU

No comments:

Post a Comment