Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Redmine is an open-source project management and issue-tracking tool that is widely used in software development and IT environments. It is highly customizable and supports multiple projects, wikis, forums, time tracking, and more. Redmine is particularly beneficial for teams using Agile methodologies, as it integrates well with version control systems like Git and Subversion.
In this article, we will explore how to install and configure Redmine on a Linux server. The steps provided are tailored for a Debian-based distribution (like Ubuntu), but can be adapted for other distributions with minor adjustments.
Examples:
Install Dependencies
First, update your package list and install the necessary dependencies:
sudo apt update
sudo apt install -y build-essential libmysqlclient-dev libmagickwand-dev imagemagick libssl-dev libreadline-dev zlib1g-dev
Install Ruby
Redmine is a Ruby on Rails application, so you need to install Ruby. You can use RVM (Ruby Version Manager) to manage Ruby versions:
sudo apt install -y curl gpg
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.7.2
rvm use 2.7.2 --default
Install Rails
Install Rails using the gem package manager:
gem install rails -v 6.0.3.4
Install and Configure MySQL
Redmine uses a database to store its data. Install MySQL server and create a database for Redmine:
sudo apt install -y mysql-server
sudo mysql_secure_installation
sudo mysql -u root -p
Inside the MySQL shell, create a database and user for Redmine:
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Download and Configure Redmine
Download the latest stable version of Redmine:
cd /opt
sudo wget http://www.redmine.org/releases/redmine-4.1.1.tar.gz
sudo tar -xzf redmine-4.1.1.tar.gz
sudo mv redmine-4.1.1 redmine
cd redmine
Copy the example configuration files:
sudo cp config/database.yml.example config/database.yml
sudo cp config/configuration.yml.example config/configuration.yml
Edit the config/database.yml
file to include your MySQL database details:
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "your_password"
encoding: utf8mb4
Install Bundler and Required Gems
Install Bundler and the required gems:
gem install bundler
bundle install --without development test
Generate Secret Token and Migrate Database
Generate a secret token for session management and migrate the database:
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data
Set Up File Permissions
Ensure that the Redmine directory has the correct permissions:
sudo chown -R www-data:www-data /opt/redmine
sudo chmod -R 755 /opt/redmine
Configure Apache with Passenger
Install Passenger and configure Apache to serve the Redmine application:
sudo apt install -y libapache2-mod-passenger
sudo a2enmod passenger
Create a new virtual host configuration for Redmine:
sudo nano /etc/apache2/sites-available/redmine.conf
Add the following content:
<VirtualHost *:80>
ServerName your_domain_or_IP
DocumentRoot /opt/redmine/public
<Directory /opt/redmine/public>
Require all granted
Options -MultiViews
</Directory>
</VirtualHost>
Enable the site and restart Apache:
sudo a2ensite redmine.conf
sudo systemctl restart apache2
Access Redmine
Open your web browser and navigate to http://your_domain_or_IP
. You should see the Redmine login page. The default login credentials are:
Make sure to change the default password after logging in.