Recently we moved to dreamhost VPS server and signed in for 3 year service. We were using redmine in our projects for handling project management activities. After successful installation of latest redmine release on local server, it was time to move on to install and test it on webservers. But when we contacted Dreamhost support they have standard reply,
Thank you for writing into DreamHost Support!
Unfortunately, we cannot assist with custom configs for that application,Dreamhost Support Reply
My apologies. If you need root access for the install then you would need
to use a dedicated server or DreamCompute and that would not be allowed on your current VPS.
There are multiple resources available across the web about Redmine on Dreamhost, but they’re all quite outdated. Well redmine is flexible project management web application and is free to use opensource software. We did not stop here, as we were so much impressed with capabilities of redmine for project management and reporting. So we have started with installation of ruby on rails on VPS (virtual private server).
- 0.1 Step 0 – Pre-Build
- 0.2 Step 1 – Create Database
- 0.3 Step 2 – Configure Database
- 0.4 Step 3 – Migrate Database and Load Defaults
- 0.5 Step 4 – Final Rake Command
- 0.6 Step 5 – (Optional) Run webrick service as background process
- 0.7 Step 6 – Configuration Steps For Apache Server
- 1 Share this:
- 2 Like this:
- 3 Related
Step 0 – Pre-Build
- Enable Passenger (Ruby/NodeJS/Python apps only) under ‘domains’->’Manage Domains’ from dreamhost cpanel
- Install RVM (Ruby version Manager) using steps mentioned in dreamhost help center
- Install ImageMagick current gem as redmine requires it and DreamHost servers don’t have it
- mkdir src && cd src
- Get latest source from imagemagic website using $ wget http://www.imagemagick.org/download/
- mkdir ~/lib
- tar xfz ImageMagick-7.0*
- Now navigate to ImageMagick-7.0* folder and configure
- ./configure –prefix=/home/username/lib/ImageMagick-7.0.8-68
- make install
- export PKG_CONFIG_PATH=’/home/username/lib/ImageMagick-7.0.8-68/lib/pkgconfig’
- export C_INCLUDE_PATH=’/home/username/lib/ImageMagick-7.0.8-68/include’
- source ~/.bash_profile
- Download latest redmine archive and decompress it in /public folder
- wget http://www.redmine.org/releases/redmine-4.0.4.tar.gz
- tar xfz redmine-4.0.4.tar.gz –strip-components=1
- Install dependencies –
$ gem install bundler
$ bundle install
- If you are still getting issue with ImageMagick then bypass rmagick and continue
- bundle install –without development test rmagick
- Generate session store key
- $ bundle exec rake generate_secret_token
- After this command, if your VPS is Debian 9.12 (aka Stretch) you will get following error, but don’t worry, just run – $ bundle update
$ bundle exec rake generate_secret_token
Could not find gem 'mysql2 (~> 0.5.0)' in any of the gem sources listed in your Gemfile.
All above steps are required if you are using Dreamhost VPS/Shared server, If you are using dedicated servers then above tricks are not required for you.
Step 1 – Create Database
Create empty database using ‘MySQL database’ section of cpanel from dreamhost. This will create database and hostname, Note down these details along with username and password, as these are required in next step.
Step 2 – Configure Database
Configure the database in config/database.yml file, first rename ‘database.yml.example’ to ‘database.yml’. Open this configuration file and enter details as noted in step 1. The ‘database.yml’ file should look as below,
production: adapter: mysql2 database: <db_name from step1> host: <host_name from step1> username: <user_name from step1> password: <user_password from step1>
Step 3 – Migrate Database and Load Defaults
Create the database structure by running the redmine migrations
$ RAILS_ENV=production rake db:migrate
$ bundle exec rake db:migrate
At this moment, if you see issue with Sprockets, use steps to upgrade sprockets and you are good to go for final rake command.
rake aborted! Sprockets::Railtie::ManifestNeededError: Expected to find a manifest file in `app/assets/config/manifest.js`
It is easy as mentioned in the error log also, just create ‘ app/assets/config/manifest.js’ and copy below three lines in manifest file
//= link_tree ../images
//= link_directory ../stylesheets .css
Step 4 – Final Rake Command
$RAILS_ENV=production bundle exec rake redmine:load_default_data
Now test your redmine server using wbrick command.
$bundle exec rails server webrick -e production http://<host_name>:3000/
Step 5 – (Optional) Run webrick service as background process
With webrick running in background you need not to start the server again and it runs even after you close the session.
$ruby script/server webrick -e production -du Or Try following $ruby script/server webrick -e development -d
Step 6 – Configuration Steps For Apache Server
1. You need to modify two files for apache. The first is /etc/apache2/mods-available/passenger.conf which needs the text PassengerDefaultUser www-data added as seen below.
2. Now create a symlink to connect Redmine into the web document space:
$ sudo ln -s /home/ilmp_redmine/<PWD>/public /var/www/html/redmine
3. And modify /etc/apache2/sites-available/000-default.conf as follows
4. Create and set the ownership of a Gemfile.lock file so that apache’s www-data user can access it:
$ sudo chown www-data:www-data /home/ilmp_redmine/<PWD>/public/Gemfile.lock
5. Now restart apache:
$ sudo service apache2 restart
Feel free to drop a comment or email @ email@example.com, if you get stuck somewhere, we will try to help you as much as possible. Check out our services and offerings at RedmineLab.com
Thank you for reading this post about ‘install redmine on VPS’ happy redmining using dreamhost.