We are trying to install redmine on AWS server using CLI – command line. This step by step guide will help you to setup. There is docker file available on AWS markatepalce . This redmine was installed on other AWS instance running Ubuntu. But with this user is getting error while downloading attachments. User is getting “Internal server error”, and he is not able to download the attachments. So we have decided to install redmine using command line. This helped to solve the issue and now redmine is running on new AWS instance.

We have installed our redmine in /var/data/redmine/redmine-4.2.1 .(redmine installation guide) We are using webrick web server for redmine and its default output is at port 3000 . We need our redmine to be available at default apache welcome page .i.e. at the public ip.

Here are some steps to achieve the same result:

Step 1: Create a virtual host for redmine

cd /etc/apache2/sites-available
sudo vim redmine.conf

paste the configurations in file ( ctrl+shift+v)

<VirtualHost *:80>
        DocumentRoot /var/data/redmine/redmine-4.2.1/public
        ServerName <server ip>
        <Directory /var/data/redmine/redmine-4.2.1/public>
          Allow from all 
          Options -MultiViews
          Require all granted
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

now save the file.

Step 2: Create Symbolic Link of redmine public directory

sudo ln -s  /var/data/redmine/redmine-4.2.1/public    /var/www/html/redmine

Step 3: Add www-data user in passenger.conf module

$ sudo vim /etc/apache2/mods-available/passenger.conf

add PassengerDefaultUser www-data .

<IfModule mod_passenger.c>
  PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
  PassengerDefaultRuby /usr/bin/ruby
  PassengerDefaultUser www-data
</IfModule>

save file .

Step 4 : Disable default site

/etc/apache2/sites-available$ sudo a2dissite 000-default.conf 
Site 000-default disabled.
To activate the new configuration, you need to run:
  systemctl reload apache2

Step 5 : Enable new site .

/etc/apache2/sites-available$ sudo a2ensite redmine.conf 
Enabling site redmine.
To activate the new configuration, you need to run:
  systemctl reload apache2

Step 6: Restart apache server.

$ systemctl reload apache2
OR
$ sudo service apache2 restart
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to reload 'apache2.service'.
Authenticating as: someshwar
Password: 
==== AUTHENTICATION COMPLETE ===

Now , visit the server ip from browser and type in public URL , we have redmine up and running. Happy redmineing and project management. We are glad, this post on install redmine on AWS server using CLI – command line helped you.