Monday 24 March 2014

Install Confluence on CentOS 6.5 and/or Fedora 19

This should help to install Confluence (Wiki) with some useful customisation.
The installation documentation will work for either CentOS 6.5 or Fedora 19 with MySQL/MariaDB 5..5.35+.
Some of the steps are duplicated if JIRA is already installed on the server.

  1. download the latest version of Confluence from Atlassian
     
  2. install and configure an up-to-date version of Java.
    i.e. java -version   --->>  java version "1.7.0_51"
  3. download the Java Connector version > 5.1.28 from Oracle (see git install)
     
  4. GOTCHA !!!   remove all previous Confluence accounts, groups and installations unless you want to upgrade !!!
     
  5. copy both to the destination machine
    change permissions to 755 on confluence binary package
     
  6. install the Java Connector into the /usr/share/java/
    and replace old links of mysql-connector-java.jar (see git install)
     
  7. prepare the database (local or different db server)
    CREATE USER 'wiki'@'localhost(remote host)' IDENTIFIED BY 'supersecret';
    CREATE DATABASE IF NOT EXISTS `wiki_db` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
    GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `wiki_db`.* TO 'wiki'@'localhost (or other hostname)';
     
  8. prepare a data directory/file-system i.e. on a storage device for easier back-up.
    i.e. /data/wiki
     
  9. prepare a directory for central logging /var/log/wiki
     
  10. decide which tomcat ports you want to use; this is not needed when you run Confluence on its own server.
     
  11. next still as superuser, execute the confluence binary
     
  12. GOTCHA !!!   before starting Confluence or logging onto the gui for the remaining configuration, you have to copy the java-connector
    GOTCHA !!!   it has to be a "copy" linking does not work with Confluence
    cd /opt/atlassian/confluence/lib  (the default installation)
    cp -p /usr/share/java/mysql-connector-java-5.1.28/mysql-connector-java-5.1.28-bin.jar mysql-connector-java.jar
    Without this copy or link you will not see the database.
     
  13. Questions / Prompts during install:
    1. This will install Confluence 5.4 on your computer   --->  press Enter
    2. Choose the appropriate installation or upgrade option   --->    2 + Enter
    3. Where should Confluence 5.4 be installed?   --->  press Enter
    4. Default location for Wiki data (see item 6.)   --->  /data/wiki  + Enter
    5. Configure which ports Confluence will use (see item 8)   --->  select option and Enter
    6. Install Confluence as Service? (silly question)   --->  press Enter
    7. Finishing installation ...
       
  14. Now is the time for item 10. !!!
     
  15. Enter the database connection details into the file: /data/wiki/confluence.cfg.xml
     
  16. Also do Item 7.now.
    1. mv /data/wiki/logs/atlassian-confluence.log  /var/log/wiki/
    2. rmdir /data/wiki/logs
    3. ln -s /var/log/wiki /data/wiki/logs
    4. cd /opt/atlassian/confluence
    5. mv logs/* /var/log/wiki/
    6. rmdir logs
    7. ln -s /var/log/wiki logs
       
  17. Restart JIRA and log-in to the gui to configure the admin user and the database.
     
  18. lastly configure Apache or nginx as the gateway.

Thursday 20 March 2014

Install Jira on CentOS 6.5 and/or Fedora 19

This should help to install JIRA with some useful customisation.
The installation documentation will work for either CentOS 6.5 or Fedora 19 with MySQL/MariaDB 5..5.35+.

Some of the steps are duplicated if Confluence is already installed on the server.

  1. download the latest version of JIRA from Atlassian
     
  2. install and configure an up-to-date version of Java.
    i.e. java -version   --->>  java version "1.7.0_51"
  3. download the Java Connector version > 5.1.28 from Oracle (see git install)
     
  4. GOTCHA !!!   remove all previous JIRA accounts, groups and installations unless you want to upgrade !!!
     
  5. copy both to the destination machine
    change permissions to 755 on JIRA
     
  6. install the Java Connector into the /usr/share/java/
    and replace old links of mysql-connector-java.jar (see git install)
     
  7. prepare the database (local or different db server)
    CREATE USER 'jira'@'localhost(remote host)' IDENTIFIED BY 'supersecret';CREATE DATABASE IF NOT EXISTS `jira_db` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
    GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `jira_db`.* TO 'jira'@'localhost (or other hostname)';
     
  8. prepare a data directory/file-system i.e. on a storage device for easier back-up.
    i.e. /data/jira
     
  9. prepare a directory for central logging /var/log/jira
     
  10. decide which tomcat ports you want to use; this is not needed when you run JIRA on its own server.
     
  11. next still as superuser, execute the JIRA binary
     
  12. GOTCHA !!!   before starting JIRA or logging onto the gui for the remaining configuration, you have to create a link (or copy) the java-connector
    cd /opt/atlassian/jira/lib  (the default installation)
    ln -s /usr/share/java/mysql-connector-java-5.1.28/mysql-connector-java-5.1.28-bin.jar mysql-connector-java.jar
    Without this copy or link you will not see the database.
     
  13. Questions / Prompts during install:
    1. This will install JIRA 6.2 on your computer   --->  press Enter
    2. Choose the appropriate installation or upgrade option   --->    2 + Enter
    3. Where should JIRA 6.2 be installed?   --->  press Enter
    4. Default location for JIRA data (see item 6.)   --->  /data/jira  + Enter
    5. Configure which ports JIRA will use (see item 8)   --->  select option and Enter
    6. Install JIRA as Service? (silly question)   --->  press Enter
    7. Finishing installation ...
       
  14. Now is the time for item 10. !!!
  15. Enter the database connection details into the file: /data/jira/dbconfig.xml
  16. Also do Item 7.now.
    1. mv /data/jira/log/atlassian-jira.log  /var/log/jira/
    2. rmdir /data/jira/log
    3. ln -s /var/log/jira /data/jira/log
    4. cd /opt/atlassian/jira
    5. mv logs/* /var/log/jira/
    6. rmdir logs
    7. ln -s /var/log/jira logs
       
  17. Restart JIRA and log-in to the gui to configure the admin user and the database.
     
  18. lastly configure Apache or nginx as the gateway.

Install gitlab on CentOS 6.5 / Fedora 19

*** Unfinished / Draft ***


Frustrated by incomplete documentation, wrong tips and hints on multiple boards or blogs and endless trial and errors initiated this page.


I hope this saves some peeps from this Bash Head

Here it goes... ensure you test your steps.
Hint: The font courier and the bold typeface are commands you should run or check ...
Red Highlights: this can be an error and might cause things to break - watch out ...



  1. ensure your OS CentOS or Fedora is up to date.
    I am using CentOS 6.5 and Fedora 19 with MariaDB/MySQL.

  2. run  yum update  and fix all issues, restart the server if a new Kernel has been installed.check the latest kernel is running with ls /boot | grep vmlinuz and uname -r my two examples are:

    CentOS:

    addis [~] > ls /boot | grep vmlinuz
    vmlinuz-2.6.32-431.3.1.el6.centos.plus.x86_64
    vmlinuz-2.6.32-431.el6.x86_64
    addis [~] > uname -r
    2.6.32-431.3.1.el6.centos.plus.x86_64

    Fedora:
    addi
    s [~] > ls /boot | grep vmlinuz
    vmlinuz-0-rescue-addc535f9a442c42bcb0afb2490b80cf
    vmlinuz-3.11.10-100.fc18.x86_64
    vmlinuz-3.12.7-200.fc19.x86_64
    vmlinuz-3.12.8-200.fc19.x86_64
    addis [~] > uname -r
    3.12.7-200.fc19.x86_64

    Gotcha: not the last Kernel is running on Fedora --->>  reboot and fix it !!!
  3. now we need to add another Repository to the already available yum repos
    yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

    your repository listing should look like this:yum repolist
    repo id                       repo name                                          status
    base                          CentOS-6 - Base                                     6,367
    centosplus                    CentOS-6 - Plus                                        24
    contrib                       CentOS-6 - Contrib                                      0
    epel                          Extra Packages for Enterprise Linux 6 - x86_64     10,397
    extras                        CentOS-6 - Extras                                      14
    mariadb                       MariaDB                                                 9
    rpmforge                      RHEL   6 - RPMforge.net - dag                       4,650updates                       CentOS-6 - Updates                                    399repolist: 21,860

    and:

    repo id                       repo name                                          status
    fedora/19/x86_64              Fedora 19 - x86_64                                 36,253updates/19/x86_64             Fedora 19 - x86_64 - Updates                       17,384updates-testing/19/x86_64     Fedora 19 - x86_64 - Test Updates                   6,420repolist: 60,057
  4. next add some packages required for the gitlab install and configure.
    yum -y install vim-enhanced vim-minimal vim-commonyum -y groupinstall "Development Tools"yum --enablerepo=epel -y install libyaml libyaml-devel readline-devel ncurses-devel gdbm-devel tcl-devel openssl-devel db4-devel libffi-devel wgetyum -y install mysql-connector-odbc mysql-connector-javayum -y install python python-docutils git-coreyum -y install MariaDB-shared MariaDB-server MariaDB-devel MariaDB-compat MariaDB-client
  5. now Versions nee to be checked:
    git --version
    Gotcha: need to be 1.7.12 or 1.8.4 or newer.
    ll /usr/share/java/mysql-connector-java.jar
    Gotcha: need to be 5.1.28 or newer.
    rpm -q  MariaDB-server
    Gotcha: need to be 5.5.30 or newer
    ruby --version
    Gotcha: need to be 2.0 or newer.
  6. first fixes:
    there are some strange fixes, well actually these are hacks!
    but we have to ensure all works without breaking any dependencies ...Being confused

    1. git is too old...  lets fix it - remove the wrong version and install the correct one!
        Gotcha: do not use yum erase here !!!
        rm -rf /usr/bin/git* /usr/libexec/git*
        mkdir ~/src; cd ~/src
        curl --progress https://git-core.googlecode.com/files/git-1.8.5.2.tar.gz | tar xz
        cd git-1.8.5.2/
        make prefix=/usr all
        sudo make prefix=/usr install
        This installed git where we deleted it - smart!!!

    2. java-connector too old - get the newer connector
        cd /tmp
        wget http://ftp.jaist.ac.jp/pub/mysql/Downloads/Connector-J/mysql-connector-java-5.1.28.tar.gz
        cd /usr/share/java
        rm /usr/share/java/mysql-connector-java.jar
        tar xfz /tmp/mysql-connector-java-5.1.28.tar.gz
        ln -s mysql-connector-java-5.1.28/mysql-connector-java-5.1.28-bin.jar mysql-connector-java.jar

    3. MySQL / MariaDB too old
        get the latest yum updates from epel or tes/ting.

    4. update ruby
        mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
        wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz -P rpmbuild/SOURCES
        wget https://raw.github.com/hansode/ruby-2.0.0-r      pm/master/ruby200.spec -P rpmbuild/SPECS
    rpmbuild -bb rpmbuild/SPECS/ruby200.spec
    rpm -Uvh rpmbuild/RPMS/x86_64/ruby-2.0.0p353-2.el6.x86_64.rpm
    ruby -v
    gem -v
  7. Create the git user:
    adduser --system --shell /sbin/nologin --comment 'GitLab' --create-home --home-dir /var/lib/git git
  8. Install GitLab-Shell.
    cd /var/lib/git
    sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-shell.git -b v1.8.0
    cd gitlab-shell
    sudo -u git -H cp config.yml.example config.yml
    edit the config.yml and replace domain with a proper domain
    sudo -u git -H /usr/local/bin/ruby ./bin/install
  9. Create the database.
    log into MySQL (on localhost or on db-server)
    CREATE USER 'git'@'localhost(remote host)' IDENTIFIED BY 'supersecret';
    CREATE DATABASE IF NOT EXISTS `gitlab_db` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
    GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlab_db`.* TO 'git'@'localhost (or other hostname)';

    Test the MySQL connection.
  10. Install GitLab
    cd /var/lib/gitsudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 6-6-stable gitlab
    sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
    edit config/gitlab.yml and configure the
        domain properly
        data path to where you want the repositories to live (i.e.  /data/repos)

    sudo chown -R git log/
    sudo chown -R git tmp/
    sudo chmod -R u+rwX  log/
    sudo chmod -R u+rwX  tmp/
    sudo -u git -H mkdir /home/git/gitlab-satellites
    sudo -u git -H mkdir tmp/pids/
    sudo -u git -H mkdir tmp/sockets/
    sudo chmod -R u+rwX  tmp/pids/
    sudo chmod -R u+rwX  tmp/sockets/
    sudo -u git -H mkdir public/uploads
    sudo chmod -R u+rwX  public/uploads

    sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
    edit config/unicorn.rb to amend the server/memory settings if required.

    sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb

    sudo -u git -H git config --global user.name "GitLab"
    sudo -u git -H git config --global user.email "gitlab@localhost" (set to admin email)
    sudo -u git -H git config --global core.autocrlf input
  11. now add the database to gitlab
    sudo -u git -H cp config/database.yml.mysql  
    config/database.yml
    edit the 
    config/database.yml file with the connection details

    install the gems for MySQL
    sudo -u git -H /usr/local/bin/bundle install --deployment --without development test postgres aws

    populate the database
    sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
    enter "Yes" when prompted.
  12. configure the init script and enable Git.
    wget -O /etc/init.d/gitlab https://gitlab.com/gitlab-org/gitlabrecipes/raw/master/init/sysvinit/centos/gitlab-unicorn
    chmod +x /etc/init.d/gitlab
    chkconfig --add gitlabchkconfig gitlab on
  13. check - start - set-up assets
    sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
    service gitlab start
    sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
  14. add apache or nginx