YouTrack v2017.1 on CentOS v7.x as a ZIP installation
Installation notes for install YouTrack on a VM as a ZIP installation. The installation uses Nginx as a reverse proxy to provide https. An external hub instance is used for authentication. The VM is running CentOS v7.3, with OpenJDK v1.8.0
OpenJDK
Install the latest OpenJDK:
# yum install java-1.8.0-openjdk-headless
YouTrack
Add an account for the youtrack service:
# adduser -c "YouTrack Issue Tracker" -m -d /srv/youtrack -r youtrack
As the 'youtrack' user (from the 'youtrack' home directory) download the distribution jar and create a symbolic link with a fixed name. When an upgrade is available, the link can be updated to perform an inplace upgrade.
$ wget https://download.jetbrains.com/charisma/youtrack-2017.1.31650.zip $ unzip youtrack-2017.1.31650.zip $ ln -s youtrack-2017.1.31650 youtrack
systemd
Create a systemd service file '/lib/systemd/system/youtrack.service' to run the service as the youtrack user:
[Unit] Description=JetBrains Youtrack Requires=network.target After=syslog.target network.target [Service] Type=simple User=youtrack EnvironmentFile=-/etc/default/youtrack WorkingDirectory=/srv/youtrack ExecStart=/srv/youtrack/youtrack/bin/youtrack.sh run ExecStop=/srv/youtrack/youtrack/bin/youtrack.sh stop StandardOutput=journal StandardError=inherit [Install] WantedBy=multi-user.target
Add the following to the file '/etc/default/youtrack' to configure the service:
# # The listen url of the form [host:]<port>[/contextPath] # LISTEN_URL=8080 # # Additional JVM options # VM_OPTS0=-Xmx1g VM_OPTS1=-XX:MaxMetaspaceSize=250M VM_OPTS2=-Djava.security.egd=/dev/zrandom VM_OPTS3=-Djetbrains.youtrack.disableBrowser=true VM_OPTS4=
Enable and start the service:
# systemctl enable youtrack # systemctl start youtrack
Firewall
Over and above standard firewall access (ssh, dns, http, local smtp); allow ingress for http for the main web interface (port 8080):
-A tcpIn -p tcp -m tcp --source 10.20.7.0/24 --dport 8080 -m conntrack --ctstate NEW -j ACCEPT
Note: If you are using the standard firewall then
# firewall-cmd --zone=public --permanent --add-port=8080/tcp # firewall-cmd --reload
Logs
Setup a link to the logs so they are easy to access:
# ln -s /srv/youtrack/.youtrack/logs /var/log/youtrack
Configuration
Links
- https://www.jetbrains.com/youtrack/
- https://confluence.jetbrains.com/display/YTD6/Using+YouTrack+JAR+Distribution
- https://confluence.jetbrains.com/display/YTD65/Migrating+YouTrack+Data+to+External+Hub
- https://confluence.jetbrains.com/display/YTD65/YouTrack+Start+Java+Parameters
- Base VM
- systemd
Appendices
youtrack.sh help
/srv/youtrack/youtrack/bin/youtrack.sh Usage: /bin/sh /srv/youtrack/youtrack-2017.1.31650/bin/youtrack.sh <command> <command> can be one of the following: configure configures YouTrack, call "help configure" for details start starts YouTrack in background, call "help start" for details run runs YouTrack in the current console, call "help run" for details status prints YouTrack status, call "help status" for details stop shuts YouTrack down, call "help stop" for details restart restarts YouTrack in background, call "help restart" for details rerun reruns YouTrack in the current console, call "help rerun" for details dump provides some YouTrack debug info, call "help dump" for details kill kills YouTrack process java manages the path to the Java for YouTrack, call "help java" for details help prints usage text help <command name> prints usage text for the specified command
Restore Issue
The setup wizard either allows:
- restore of database
- setup directorys and selection of the hub instance
When a YouTrack 6.0 backup was chosen the following error was generated:
The selected archive file contains a valid YouTrack database, but does not contain data of built-in Hub. Please select an existing YouTrack installation or a valid YouTrack backup that contains Hub database