Atlassian FishEye on a CentOS v6.x VM
How to install and run Atlassian FishEye on a CentOS 6 virtual machine.
Prerequisites
The following prerequisite steps should be performed
- Install the VM operating system and apply updates
- Lock down SSH
- Add users and provision access (add SSH public keys)
- Install VMWare tools (if required)
- Install time synchronisation (if required)
- Install an http/https reverse proxy that forwards to the fisheye server
Installation
Add a fisheye system account. The init script will run the java process as this user.
# adduser -r -M -c "Atlassian FishEye" fisheye
Download the binary files from Atlassian:
$ wget http://downloads.atlassian.com/software/fisheye/downloads/fisheye-3.1.1.zip
Unzip/install to the '/srv' directory, and create a smbolic link to the fisheye directory:
# unzip fisheye-3.1.1.zip -d /srv # chown -Rv fisheye.fisheye /srv/fecru* # ln -s fecru-3.1.1 /srv/fisheye
Add the init script as per the appendix into '/etc/init.d/fisheye' and install it:
# chkconfig --add fisheye # chmod +x /etc/init.d/fisheye
Install Java
# yum install java-1.7.0-openjdk
Start fisheye
# service fisheye start
Add an iptables rule to allow the reverse proxy access to the fisheye instance and restart iptables:
-A INPUT -m state --state NEW -m tcp -p tcp --source 10.1.2.3 --dport 8060 -j ACCEPT
Use a web browser to view/configure the FishEye instance
Links
- https://www.atlassian.com/software/fisheye/overview
- https://confluence.atlassian.com/display/FISHKB/How+to+start+FishEye+and+Crucible+at+boot+time+on+Linux
- http://ruleoftech.com/2012/running-fisheye-crucible-as-a-service-in-linux
Appendices
Init script
#!/bin/bash # chkconfig: 2345 40 60 # description: Starts and stops FishEye # # config: /etc/sysconfig/fisheye # ### BEGIN INIT INFO # Provides: fisheye # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop fisheye # Description: Start and stop fisheye ### END INIT INFO . /etc/init.d/functions [ -f "/etc/sysconfig/fisheye" ] && . "/etc/sysconfig/fisheye" FISHEYE_USER=${FISHEYE_USER:-fisheye} FISHEYE_HOME=${FISHEYE_HOME:-/srv/fisheye} fisheyectl() { daemon --user "$FISHEYE_USER" "$FISHEYE_HOME/bin/fisheyectl.sh" "$1" } case "$1" in start) fisheyectl start ;; stop) fisheyectl stop ;; restart) fisheyectl stop sleep 10 fisheyectl start ;; *) echo "Usage: $0 {start|stop|restart}" esac exit 0
Startup log
INFO - FishEye arguments: [] INFO - FishEye/Crucible 3.1.1 (20130829034307), Built on 2013-08-29 INFO - Logging started (Oracle Corporation|23.7-b01|/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.25.x86_64/jre |Linux|amd64|2.6.32-358.el6.x86_64|maxmem=1011MB) INFO - UpgradeManager started. INFO - loading config from file: /srv/fisheye/config.xml INFO - INFO - ======================================================= INFO - INFO - Welcome to FishEye! INFO - INFO - You need to configure an admin password and enter your INFO - license key. You can do this by accessing FishEye through INFO - a web browser, once the server has started: INFO - INFO - http://localhost:8060 INFO - INFO - Refer to the FishEye administration guide INFO - for more information: INFO - INFO - https://confluence.atlassian.com/display/FISHEYE/Starting+to+use+FishEye INFO - INFO - ======================================================= INFO - INFO - Your Server ID is XXXX-YYYY-ZZZZ-AAAA INFO - Index version is null, and not upgradable, resetting index.
Nginx reverse proxy config
# # FishEye server # server { listen [::]:80; server_name fisheye.mydomain.com; location / { # redirect to secure page [permanent | redirect] rewrite ^ https://fisheye.mydomain.com$request_uri? permanent; } } server { listen [::]:443; server_name fisheye.mydomain.com; keepalive_timeout 70; ssl on; ssl_certificate certs/fisheye.mydomain.com.startssl.crt; ssl_certificate_key certs/fisheye.mydomain.com.key; access_log /var/log/nginx/fisheye.mydomain.com.access.log main; location / { proxy_pass http://10.11.12.13:8060/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffering off; client_max_body_size 64m; client_body_buffer_size 256k; } }