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.

No comments: