Archive

Archive for April, 2009

Install msmpt-mta on ubuntu 9.04

April 1st, 2009 No comments

This will install msmtp-mta on your computer, a nice little mta that uses for example gmail for outgoing mails.

We install the packages:

sudo apt-get install msmtp-mta

We change the config file:

vim /etc/msmtprc

A sample file for google:

account gmail_robomailer
host smtp.gmail.com
port 587
auto_from off
auth on
user yourAccount@googlemail.com
password yourPassword
tls on
tls_starttls on
from yourAccount@googlemail.com
maildomain googlemail.com
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile
syslog LOG_MAIL
account default: gmail_robomailer

For further details check:

man msmtp

Sample usage from a php.ini file:

sendmail_path = /usr/bin/msmtp -t -i

To test if the setup was successful you can send your self a mail via command line:

cat <<EOF | msmtp -a gmail_robomailer some@email.tld
From: yourAccount@googlemail.com
To: some@email.tld
Subject: test

This is a test!
EOF
Categories: Linux, smtp Tags: , , ,

Install Redmine 0.8.1 on Ubuntu Server 9.04

April 1st, 2009 7 comments

This howto is based on Chris’s howto. It has been tested and modified to work with ubuntu server 9.04.

First we change to root and install the base packages:

sudo su
apt-get install apache2 ruby rubygems subversion ruby-pkg-tools \
ruby1.8-dev build-essential postgresql libdbd-pg-perl libapache2-svn \
libapache-dbi-perl libapache2-mod-perl2 libdigest-sha1-perl \
libopenssl-ruby librmagick-ruby git-core git ruby-dev

Now we install the ruby gems:

gem install rails -v 2.1.2
gem install rake -v 0.8.3
gem install mongrel mongrel_cluster postgres-pr --include-dependencies

We add the gems to $PATH:

echo "export PATH=$PATH:/var/lib/gems/1.8/bin" >> ~/.bashrc

Now we setup the database, there for we first change to the postgres user:

su postgres

Now we create a database user and a database for redmine, in this howto we use redmine as password for the redmine user.

createuser redmine --no-superuser --no-createdb --no-createrole --login --pwprompt --encrypted
createdb --owner=redmine --encoding=utf-8 redmine
exit

We create a user for redmine and some user specific directories:

addgroup redmine
useradd -g redmine -s /bin/false -m redmine

Now we proceed installing redmine it self from svn into a new created directory:

cd /var/www/rails_apps/redmine
svn co http://redmine.rubyforge.org/svn/tags/0.8.1/
ln -s 0.8.1 redmine

We can now configure database access for redmine:

vim /var/www/rails_apps/redmine/config/database.yml

Add the following information:

production:
  adapter: postgresql
  database: redmine
  host: localhost
  username: redmine
  password: redmine

Now we boostrap the database:

rake rails:update
rake db:migrate RAILS_ENV="production"
rake redmine:load_default_data RAILS_ENV="production"

Change some rights:

cd /var/www/rails_apps/redmine
mkdir tmp public/plugin_assets
sudo chown -R redmine:redmine files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets

To configure your email settings change the following file:

vim /var/www/rails_apps/redmine/config/email.yml

Default content:

# Outgoing email settings

production:
  delivery_method: :smtp
  smtp_settings:
    address: smtp.example.net
    port: 25
    domain: example.net
    authentication: :login
    user_name: redmine@example.net
    password: redmine

development:
  delivery_method: :smtp
  smtp_settings:
    address: 127.0.0.1
    port: 25
    domain: example.net
    authentication: :login
    user_name: redmine@example.net
    password: redmine

Now we can try to run redmine from it’s directory:

cd /var/www/rails_apps/redmine
mongrel_rails start --environment=production
or we can use WebRick
ruby script/server webrick -e production

It uses port 3000 as default, thus you can call redmine at:


http://yourIP:3000

To logon, enter username admin and password admin.

If you want to use a svn repository via http you can configure it when creating a project via the redmine interface. If you use https for your repository, you should check it out once locally on the webserver first with the redmine user that has been used to start redmine. You have to accept the certificate permanently, and then redmine can use it as well.

I would suggest to run redmin in a screen session, there fore we install screen.