Environment Introduction:
CentOS Linux release 7.6.1810 (Core)
MySQL5.7
Redmine 3.3
ruby-2.3.3
Rails 4.2.6
Reference documents: http://www.redmine.org/projects/redmine/wiki/RedmineInstall
1. Preparing the Environment
The official software download source yum slow, replacing Ali yum yum source to source and install epel source
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
-o curl /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
Installation rvm and ruby
curl -L https://get.rvm.io | bash -s stable
At this time will complain, follow the prompts to perform the corresponding command to return
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
(Replace your prompt execution of the command)
Ruby set system environment
source /etc/profile.d/rvm.sh
rvm reload
rvm install 2.3.3
Ali switching source
gem source -r https://rubygems.org/
gem source -a http://mirrors.aliyun.com/rubygems/
installation
gem install rake -v 12.0.0
gem install rails -v 4.2.6
Install mysql database (5.7)
Wget https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm
Install mysql source
yum -y install mysql80-community-release-el7-2.noarch.rpm
(Note that the default installation is MySQL8.0, so after installing the source yum, yum source to modify the configuration, the mysql8.0 ban, the open source mysql5.7 after installation).
yum repolist enabled | grep mysql.*
yum install mysql-community-server
systemctl start mysqld.service
Run the following command to run state check
systemctl status mysqld.service
Look at the initial password
grep "password" /var/log/mysqld.log
log in
mysql -uroot -p
change Password
mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY '****************';
mysql>FLUSH PRIVILEGES;
Setting automatic start
systemctl enable mysqld
2. database operations
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
3. Change the profile
Extract the package redmine-3.3.0.tar.gz
tar xf redmine-3.3.0.tar.gz -C /opt
cd /opt/redmine-3.3.0
cp database.yml.example database.yml
Database.yml modify the following (this carefully, do not make change the database name, otherwise it will go wrong, the best agreement)
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "redmine"
Redmine Use Bundler gem manage dependencies, you need to install the Bundler
gem install bundler
Then you can install all the gems required by Redmine using the following command:
bundle install --without development test
(After executing this command error, the solution yum -y install ImageMagick-devel, and then perform it again undle install --without development test)
Session store secret generation:
bundle exec rake generate_secret_token
(/Opt/redmine-3.3.0), run the following command in the application root directory, create the database structure:
RAILS_ENV=production bundle exec rake db:migrate
Set default database data sets, by running the following commands, inserted into the default configuration data in the database:
RAILS_ENV=production bundle exec rake redmine:load_default_data
Enter zh
At this point, redmine installation is complete.
3. Start redmine
cd /opt/redmine-3.3.0/bin
echo –e ‘#!/bin/bash\nbundle exec rails server webrick -e production -p 3000 -b 0.0.0.0 -d’ >> start.sh
chmod +x start.sh
./start.sh
4. Access redmine