Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://kifarunix.com/install-redmine-with-apache-and-mariadb-on-centos-8/
- useradd -r -m -d /opt/redmine redmine
- dnf -y install httpd
- systemctl enable httpd --now
- usermod -aG redmine apache
- dnf install -y epel-release
- yum install -y 'dnf-command(config-manager)'
- dnf config-manager --set-enabled PowerTools
- cat << EOF > /etc/yum.repos.d/mariadb.repo
- [mariadb]
- name = MariaDB-10.4
- baseurl=http://yum.mariadb.org/10.4/centos8-amd64
- gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
- gpgcheck=1
- EOF
- rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
- dnf install -y ruby-devel rpm-build libxml2-devel make automake libtool ImageMagick ImageMagick-devel gcc httpd-devel libcurl-devel gcc-c++ ruby wget galera-4 hostname sudo openssl-devel
- #Failed to resolve typeattributeset statement at /var/lib/selinux/targeted/tmp/modules/400/mariadb/cil:1
- #/usr/sbin/semodule: Failed!
- #https://kifarunix.com/install-mariadb-10-4-on-centos-8/
- dnf --disablerepo=AppStream install -y MariaDB-server MariaDB-client MariaDB-devel
- #this might break the version of /opt/redmine/.gem/ruby/gems/passenger-6.0.6/buildout/apache2/mod_passenger.so
- yum update -y
- systemctl start mariadb
- systemctl enable mariadb
- mysql -e "create database redminedb;"
- mysql -e "grant all on redminedb.* to redmineadmin@localhost identified by 'P@ssWorD';"
- mysql -e "flush privileges;"
- wget --no-check-certificate http://www.redmine.org/releases/redmine-4.0.5.tar.gz -P /tmp
- usermod -a -G wheel redmine
- sudo -u redmine tar xzf /tmp/redmine-4.0.5.tar.gz -C /opt/redmine/ --strip-components=1
- #echo "1234" | passwd redmine --stdin
- su - redmine
- cp config/configuration.yml{.example,}
- cp public/dispatch.fcgi{.example,}
- cp config/database.yml{.example,}
- sed -i '7s/.*/ database: redminedb/' config/database.yml
- sed -i '9s/.*/ username: redmineadmin/' config/database.yml
- sed -i '10s/.*/ password: "P@ssWorD"/' config/database.yml
- gem install bundler
- bundle install --without development test --path vendor/bundle
- bundle exec rake generate_secret_token
- #bundle exec rails server webrick -e production
- #reran and it worked!
- for i in tmp tmp/pdf public/plugin_assets; do [ -d $i ] || mkdir -p $i; done
- chown -R redmine:redmine files log tmp public/plugin_assets
- chmod -R 755 /opt/redmine/
- bundle exec rails server webrick -e production &
- RAILS_ENV=production bundle exec rake db:migrate
- RAILS_ENV=production REDMINE_LANG=en bundle exec rake redmine:load_default_data
- pkill ruby
- gem install passenger --no-rdoc --no-ri
- passenger-install-apache2-module -a
- exit
- #not sure if this needs to be before "passenger-install-apache2-module -a"
- cat << EOF > /etc/httpd/conf.d/redmine.conf
- Listen 3000
- LoadModule passenger_module /opt/redmine/.gem/ruby/gems/passenger-6.0.6/buildout/apache2/mod_passenger.so
- <IfModule mod_passenger.c>
- PassengerRoot /opt/redmine/.gem/ruby/gems/passenger-6.0.6
- PassengerDefaultRuby /usr/bin/ruby
- </IfModule>
- <VirtualHost *:3000>
- ServerName redmine
- DocumentRoot "/opt/redmine/public"
- CustomLog logs/redmine_access.log combined
- ErrorLog logs/redmine_error_log
- LogLevel warn
- <Directory "/opt/redmine/public">
- Options Indexes ExecCGI FollowSymLinks
- Require all granted
- AllowOverride all
- </Directory>
- </VirtualHost>
- EOF
- mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.bak
- systemctl restart httpd
- #open ip:3000
- #have to open 3000
- #default username/pw is admin/admin
- #bundle exec rails server webrick -e production &
Add Comment
Please, Sign In to add comment