# How to Install Redmine

- Create database and a database user
- The next step navigate cPanel interface in the `Setup Ruby App` menu, and select the Ruby version (2.1), and setup the application folder, and type the app URI. **The URI can’t contain any special chatacters example (“/” “.” “,” etc,)**. When you fill all datas, please click the **Setup** button.
- Then install the neccessary Ruby on Rails application modules. In the modules row click the **show** label. It may get informed about the full module list in the system requirements of an application. The setup may take up longer shorter time (in Redmine case this his testing 07:48.96 were minutes) <ins>Installing the following Redmine modules:</ins>
    
    
    - bundle
    - i18n#0.6.11
    - builder#3.0.4
    - rails#3.2.19
    - mime-types#1.25.1
    - mocha#1.0.0
    - jquery-rails#3.1.2
    - coderay
    - fastercsv
    - request\_store
    - rbpdf
    - mysql2
    - selenium-webdriver
    - rmagick
    - shoulda#3.3.2
    - ruby-openid#2.3.0
    - request\_store#1.0.5
    - capybara#2.1.0
    - net-ldap#0.3.1
    - rack-openid
    - shoulda-matchers#1.4.1
    - redcarpet#2.3.0
    - yard
    - rake#10.4.2
    - bigdecimal

- Type the module name and click the **Add** button. If we add all neccessary mudules click the **Update** button in the top of the page Then the installer compile and installing the modules, please wait to be patient, if the proccess complete we get a following message: **`Extensions set successfully updated`** .
- click the **Restart** button.
- Then download the Redmine package in SSH: ```
    wget url http://www.redmine.org/releases/redmine-x.x.x.tar.gz
    ```
- Then extract it: ```
    tar xzf redmine-x.x.x.tar.gz
    ```
- In the next step copy the content ind the earlier created folder ```
    cp -R ~/redmine-x.x.x/* ~/redmine
    ```
- Copy or rename the database.yml, and fill up the mySQL connectios details, then save it. ```
    cp ~/redmine/config/database.yml.example ~/redmine/config/database.yml
    ```
    
    ```
    nano ~/redmine/config/database.yml
    ```
- The copy the public folder in to the /public\_html/redmine/ folder. ```
    cp -R ~/redmine/public/* ~/public_html/redmine/
    ```
- Enter the Redmine folder. ```
    cd ~/public_html/redmine
    ```
- Rename the htaccess.fcgi.example, and dispatch.fcgi.example files. ```
    cat htaccess.fcgi.example >> .htaccess
    ```
    
    ```
    cp dispatch.fcgi.example dispatch.fcgi
    ```
- Then go back to the extract the Redmine ```
    cd ~/redmine
    ```
- Add the next line in `Gemfile` file: ```
    gem "bigdecimal"
    ```
- Run the following command:  
    Activate: ```
    source ~/rubyvenv/redmine/2.1/bin/activate
    ```
    
    Install:
    
    ```
    ~/rubyvenv/redmine/2.1/bin/bundle install
    ```
    
    Generating the Secret key:
    
    ```
    ~/rubyvenv/redmine/2.1/bin/rake generate_secret_token
    ```
    
    Load the database:
    
    ```
    RAILS_ENV=production ~/rubyvenv/redmine/2.1/bin/rake db:migrate
    ```
    
    Install the sample data:
    
    ```
    RAILS_ENV=production ~/rubyvenv/redmine/2.1/bin/rake redmine:load_default_data
    ```
- The final step restart the application in cPanel.