How to install Redmine on Ubuntu lucid server¶
- Table of contents
- How to install Redmine on Ubuntu lucid server
Redmine Installation¶
- Install the LAMP stack
- Install the required packages
- Install the required Ruby gems
- Download Redmine into /user/share/redmine directory
- Create an empty MySQL database and accompanying user named redmine for example.
- Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment.
$ sudo cp /usr/share/redmine/config/database.yml.example /usr/share/redmine/config/database.yml $ sudo nano /usr/share/redmine/config/database.yml Modify to the following and save (ctrl+x) production: adapter: mysql socket: /var/run/mysqld/mysqld.sock database: redmine host: localhost username: redmine password: [password] encoding: utf8
- Generate a session store secret.
- Create the database structure, by running the following command under the application root directory:
- Insert default configuration data in database, by running the following command:
- Setting up permissions
- Test using the webrick web server
Apache Integration¶
- Install the required packages
- Add a symbolic link to the public redmine web directory
- Configure Passanger to run as www-data
- Create a new Apache site file
Add the following lines and save (ctrl+x)<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www ServerName myservername RewriteEngine on RewriteRule ^/$ /redmine [R] <Directory /var/www/redmine> RailsBaseURI /redmine PassengerResolveSymlinksInDocumentRoot on </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined </VirtualHost>
For SSL add the following text instead<VirtualHost *:443> ServerAdmin webmaster@localhost DocumentRoot /var/www ServerName myservername SSLEngine On SSLCertificateFile /etc/apache2/ssl/redmine.pem RewriteEngine on RewriteRule ^/$ /redmine [R] <Directory /var/www/redmine> RailsBaseURI /redmine PassengerResolveSymlinksInDocumentRoot on </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined </VirtualHost> - Enable the Redmine website
- Enable the Passenger and Rewite modules and restart Apache
- Test the setup
Mercurial Integration¶
- Install the latest Mercurial release
- Create the hg web directory
- Create the web cgi script file
$ sudo nano /var/www/hg/hgwebdir.cgi Add the following and save #!/usr/bin/env python # from mercurial import demandimport; demandimport.enable() from mercurial.hgweb.hgwebdir_mod import hgwebdir import mercurial.hgweb.wsgicgi as wsgicgi application = hgwebdir('hgweb.config') wsgicgi.launch(application) - Create the cgi web config file
- Setup permissions
- Create a Apache config file
$ sudo nano /etc/apache2/conf.d/hg.config Add the following and save PerlLoadModule Apache::Redmine ScriptAlias /hg "/var/www/hg/hgwebdir.cgi" <Location /hg > AuthType Basic AuthName "Mercurial" Require valid-user #Redmine auth PerlAccessHandler Apache::Authn::Redmine::access_handler PerlAuthenHandler Apache::Authn::Redmine::authen_handler RedmineDSN "DBI:mysql:database=redmine;host=localhost" RedmineDbUser "redmine" RedmineDbPass "password" </Location> - Add a symbolic link to Redmine.pm
- Enable the required Apache modules and restart Apache
- Create a new test repository and project in Redmine
$ sudo hg init /var/www/hg/repos/test $ sudo chown -R www-data:www-data /var/www/hg/repos/test Create a new project with and identifier 'test' In the project Settings > Repository set SCM: Mercurial Path to repository: /var/www/hg/repos/test Press the 'Create' button Goto to the Repository tab of the test project
- View the test repository in the web browser
Subversion Integration¶
- Install the latest Mercurial release
- Create the svn repository directory
- Setup permissions
- Add a symbolic link to Redmine.pm
- Create a Apache config file
Add the following and savePerlLoadModule Apache::Redmine <Location /svn> DAV svn SVNParentPath "/var/www/svn" Order deny,allow Deny from all Satisfy any PerlAccessHandler Apache::Authn::Redmine::access_handler PerlAuthenHandler Apache::Authn::Redmine::authen_handler AuthType Basic AuthName "Redmine Subversion Repository" #read-only access <Limit GET PROPFIND OPTIONS REPORT> Require valid-user Allow from 127.0.0.1 # Allow from another-ip Satisfy any </Limit> # write access <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> ## for mysql RedmineDSN "DBI:mysql:database=redmine;host=localhost" RedmineDbUser "redmine" RedmineDbPass "password" </Location> - Enable the required Apache modules and restart Apache
- Create a new test repository
Email Integration¶
- Install and configure Sendmail
- Update the Redmine configuration file