Install Redmine 4.1.1 on the server where CentOS 7 is installed. Basically, you should be able to update the package with the yum
command.
SELinux is disabled for some reason, so SELinux is not considered.
# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
Added SCL repository to install Ruby 2.5 from SCL repository. Also, add the packages required for Ruby-related builds.
# yum install centos-release-scl
# yum group install "Development tools"
# yum install zlib-devel
# yum install ImageMagick ImageMagick-devel
# yum install rh-ruby25 rh-ruby25-ruby-devel
# echo '/opt/rh/rh-ruby25/root/usr/lib64' > /etc/ld.so.conf.d/rh-ruby.conf
# ldconfig
# update-alternatives --display ruby
# update-alternatives --install /usr/bin/ruby ruby /opt/rh/rh-ruby25/root/bin/ruby 25 \
--slave /usr/bin/gem gem /opt/rh/rh-ruby25/root/usr/bin/gem
# ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
# gem install rails
# gem install bundler
# update-alternatives --install /usr/bin/ruby ruby /opt/rh/rh-ruby25/root/bin/ruby 25 \
--slave /usr/bin/gem gem /opt/rh/rh-ruby25/root/usr/bin/gem \
--slave /usr/local/bin/rails rails /opt/rh/rh-ruby25/root/usr/local/bin/rails \
--slave /usr/local/bin/rake rake /opt/rh/rh-ruby25/root/usr/local/bin/rake \
--slave /usr/local/bin/bundle bundle /opt/rh/rh-ruby25/root/usr/local/bin/bundle
# yum install mariadb-server mariadb-devel
# systemctl start mariadb
# systemctl enable mariadb
# mysql_secure_installation
# mysql -u root -p
MariaDB [(none)]> CREATE DATABASE redmine CHARACTER SET utf8;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON redmine.* TO redmine@localhost IDENTIFIED BY 'P@ssw0rd!';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> quit
# cd /var/www
# wget https://www.redmine.org/releases/redmine-4.1.1.tar.gz
# tar xvzf redmine-4.1.1.tar.gz
# cd /var/www/redmine-4.1.1/config
# cp database.yml.example database.yml
# vi database.yml
Changed according to MariaDB settings. Since it is MariaDB 5.5, it is ** encoding: utf8 **.
diff:/var/www/redmine-4.1.1/database.yml
production:
adapter: mysql2
database: redmine
host: localhost
- username: root
+ username: redmine
- password: ""
+ password: "P@ssw0rd!"
# Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7
- encoding: utf8mb4
+ encoding: utf8
# cd /var/www/redmine-4.1.1
# bundle install --without development test --path vendor/bundle
# bundle exec rake generate_secret_token
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production bundle exec rake redmine:load_default_data
# cd /var/www/redmine-4.1.1/public
# cp dispatch.fcgi.example dispatch.fcgi
# cp htaccess.fcgi.example .htaccess
# yum install httpd mod_fcgid fcgi fcgi-devel mod_ssl
# gem install fcgi
# cd /var/www/redmine-4.1.1
# vi Gemfile.local
Added to the end of Gemfile.local.
diff:/var/www/redmine-4.1.1/Gemfile.local
+ gem 'fcgi'
# bundle install --without development test --path vendor/bundle
# chown -R apache:apache /var/www/redmine-4.1.1
Setting that only overwrites DocumentRoot for the time being. If you need to install VirtualHost or SSL, set it as such. If ** FcgidMaxRequestLen ** is not set, the file size that can be uploaded will be limited, so describe a value larger than the setting value in Redmine.
apache:/etc/httpd/conf.d/redmine.conf
DocumentRoot /var/www/redmine-4.1.1/public
FcgidMaxRequestLen 10485760
<Directory /var/www/redmine-4.1.1/public>
Require all granted
AllowOverride All
</Directory>
Added to the end of fcgid.conf. Without it, it will not work in production.
diff:/etc/httpd/conf.d/fcgid.conf
# Use FastCGI to process .fcg .fcgi & .fpl scripts
AddHandler fcgid-script fcg fcgi fpl
# Sane place to put sockets and shared memory file
FcgidIPCDir /run/mod_fcgid
FcgidProcessTableFile /run/mod_fcgid/fcgid_shm
+
+ DefaultInitEnv RAILS_ENV production
After that, configure Firewalld and restart Apache httpd to finish.
Recommended Posts