- Install the required Ruby gems
$ sudo gem install rails -v=2.3.14 --no-ri --no-rdoc
$ sudo gem install rake -v=0.8.7 --no-ri --no-rdoc
$ sudo gem uninstall rake -v=0.9.2.2
$ sudo gem install i18n -v=0.4.2 --no-ri --no-rdoc
$ sudo gem install mysql --no-ri --no-rdoc
- Download Redmine into /user/share/redmine directory
$ sudo svn co http://redmine.rubyforge.org/svn/branches/1.3-stable /usr/share/redmine
- Create an empty MySQL database and accompanying user named redmine for example.
$ mysql -u root -p
(enter the mysql root user password)
> create database redmine character set utf8;
> create user 'redmine'@'localhost' identified by '[password]';
> grant all privileges on redmine.* to 'redmine'@'localhost' identified by '[password]';
> exit
- 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.
$ cd /usr/share/redmine
$ sudo rake generate_session_store
- Create the database structure, by running the following command under the application root directory:
$ cd /usr/share/redmine
$ sudo rake db:migrate RAILS_ENV="production"
- Insert default configuration data in database, by running the following command:
$ sudo RAILS_ENV=production rake redmine:load_default_data
- Setting up permissions
$ cd /usr/share/redmine
$ sudo chown -R www-data:www-data files log tmp public/plugin_assets
- Test using the webrick web server
$ cd /usr/share/redmine
$ ruby script/server webrick -e production
Point your web browser at http://[my server ip]:3000
You should now see the application welcome page.
Apache Integration
- Install the required packages
$ sudo apt-get install libapache2-mod-passenger
- Add a symbolic link to the public redmine web directory
$ sudo ln -s /usr/share/redmine/public /var/www/redmine
- Configure Passanger to run as www-data
$ sudo nano /etc/apache2/mods-available/passenger.conf
Add the follow line and save (ctrl+x)
PassengerDefaultUser www-data
- Create a new Apache site file
$ sudo nano /etc/apache2/sites-available/redmine
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
$ sudo a2dissite default
$ sudo a2ensite redmine
- Enable the Passenger and Rewite modules and restart Apache
$ sudo a2enmod passenger
$ sudo a2enmod rewrite
$ sudo /etc/init.d/apache2 restart
- Test the setup
Open up your favorite web browser and goto
http://[my site or ip]/redmine
Subversion Integration
- Install the latest Mercurial release
$ sudo apt-get install subversion libapache2-svn libapache-dbi-perl libapache2-mod-perl2
- Create the svn repository directory
$ sudo mkdir /var/svn
- Setup permissions
$ sudo chown -R www-data:www-data /var/svn
- Add a symbolic link to Redmine.pm
$ sudo ln -s /usr/share/redmine/extra/svn/Redmine.pm /usr/lib/perl5/Apache/Redmine.pm
$ sudo ln -s /usr/share/redmine/extra/svn/Redmine.pm /usr/lib/perl5/Apache2/Redmine.pm
- Create a Apache config file
$ sudo nano /etc/apache2/conf.d/svn.config
Add the following and save
PerlLoadModule Apache::Redmine
<Location /svn>
DAV svn
SVNParentPath "/var/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 [my server ip]
# 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
$ sudo a2enmod dav_svn
$ sudo /etc/init.d/apache2 restart
- Create a new test repository
$ sudo svnadmin create /var/svn/test
$ sudo chown -R www-data:www-data /var/svn/test
댓글 없음:
댓글 쓰기