Advertisement
AlexSledge

Atlassian on Synology DSM 5.1

Jan 20th, 2015
5,296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.29 KB | None | 0 0
  1. Atlassian JIRA & Confluence on Synology 1513+ running DSM 5.1-5022 with 4GB RAM
  2. Rev 0.01
  3. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-
  4. NOTE: This is a work in progress.
  5.  
  6. Unfinished:
  7. 01 - I'm not sure how I want to handle the service start up and shut down,
  8. and I don't currently have them working, but have included partial
  9. notes on what I'm poking at currently.
  10. 02 - FishEye, Crucible, and Bamboo aren't currently covered. I'm currently
  11. testing how well the DS1513+ handles the load of JIRA & Confluence @ 4GB.
  12.  
  13. NOTE2: Much of my life is spent standing on the shoulder's of giants, beyond
  14. some minor tweaking and testing much of this process was tread by others
  15. who came before me, and to them I give thanks for sharing their efforts.
  16. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-
  17.  
  18. Software Installer Versions
  19. ==============================================
  20. atlassian-jira-6.3.13-x32.bin
  21. atlassian-confluence-5.6.5-x32.bin
  22. atlassian-bamboo-5.7.2.tar.gz
  23. fisheye-3.6.3.zip (FishEye & Crucible)
  24. syno-i686-bootstrap_1.2-7_i686.xsh
  25.  
  26. Synology Preparation
  27. ==============================================
  28. Official Packages:
  29. [Need to dig, have added many packages prior to beginning this activity, unknown if any are silent pre-requisites]
  30.  
  31. Community Packages:
  32. phpPgAdmin - Not critical, but handy to look at the associated databases and check their basic functionality.
  33. [ https://yadi.sk/d/CmnolK-gduQ7n mercurial-evanpost.1.0.1-1.spk ??? no versioning in place yet - evaluate - there WAS a community mercurial package, but the synocommunity package store is down until 1/22 ]
  34.  
  35. Issues:
  36. A - Want phpPgAdmin to manage PostgreSQL (install community package)
  37. B - No bash shell provided by default
  38. C - Need ipkg to install bash and other optional software, use Optware:
  39.  
  40. ===============
  41. 01 INSTALL OPTWARE
  42. ===============
  43.  
  44. References:
  45. http://forum.synology.com/wiki/index.php/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc
  46.  
  47. For the Intel Atom CPU D2700 Processor in the 1513+ http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh which uses http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/ as its feed.
  48.  
  49. The steps to install the Optware bootstrap on a Synology 1513+ (provided as an .xsh file) are below.
  50.  
  51. 1) Reboot your Synology 1513+.
  52.  
  53. 2) Enable and then Login to the Command Line Interface as user "root", password is the same as for admin.
  54.  
  55. 3) Change to a directory such as "/volume1/@tmp", i.e. enter the command "cd /volume1/@tmp"
  56.  
  57. 4) Get the NAS to download the bootstrap or download the bootstrap to your PC and then copy it to a shared folder on the NAS and move it into /volume1/@tmp
  58.  
  59. wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh
  60.  
  61. 5) Set the .xsh script to be executable "chmod +x syno-i686-bootstrap_1.2-7_i686.xsh"
  62.  
  63. 6) Now run the .xsh script, enter the command "sh syno-i686-bootstrap_1.2-7_i686.xsh"
  64.  
  65. 7) After the script has finished you can delete the script file, enter the command "rm syno-i686-bootstrap_1.2-7_i686.xsh"
  66.  
  67. 8) The root profile's PATH needs to be modified such that /opt/bin and /opt/sbin are prepended to the PATH. By default root's .profile overwrites the current path, so in the /root/.profile file, comment out the following lines:
  68.  
  69. #PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
  70. #export PATH
  71.  
  72. NOTE 1: The bootstrap installer adds part of the necessary PATH change to /etc/profile automatically. In case a DSM update breaks it, the line to ensure is at the end of the file is:
  73.  
  74. PATH=/opt/bin:/opt/sbin:$PATH
  75.  
  76. NOTE 2: Both of these changes may need to be reapplied after future DSM updates.
  77.  
  78. Before:
  79. DiskStation> echo $PATH
  80. /sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/var/packages/JavaManager/target/Java/bin:/var/packages/JavaManager/target/Java/jre/bin
  81.  
  82. After:
  83. DiskStation> echo $PATH
  84. /opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/var/packages/JavaManager/target/Java/bin:/var/packages/JavaManager/target/Java/jre/bin
  85.  
  86. NOTE 3: If you have an error that /opt cannot be mounted, unmount the previous mount ("umount -f /opt" check with command "mount") and delete both old /opt and /volume1/opt folders.
  87.  
  88. 9) Reboot the NAS and login again to the Command Line Interface as user "root".
  89.  
  90. 10) Update the ipkg list of available packages using the command "ipkg update"
  91.  
  92. 11) Upgrade any ipkg installed packages to the latest versions using the command "ipkg upgrade"
  93.  
  94. 12) Finished, you can now install ipkg packages using the command "ipkg install <package name>" where <package name> is the name of the package. You can list all the available packages using the command "ipkg list". As this is a long list you can filter it using the command "ipkg list | grep <package name>" where <package name> is the text you want to search for. Alternatively, you view one page at a time using the "more" pipe, e.g. "ipkg list | more"
  95.  
  96. Note: ipkg expects to find your ipkg files/programs in the path "/opt". As the synology NAS's put all your files in "/volume1" the bootstraps put your IPKG files/programs in "/volume1/@optware" but then mount this directory so it ALSO appears as "/opt". Hence, do not think that "/volume1/@optware" and "/opt" are duplicated files, they are not duplicated, they are in fact exactly the same directory.
  97.  
  98.  
  99. ===============
  100. 02 INSTALL BASH
  101. ===============
  102.  
  103. 1) Install the bash, coreutils, and man packages with:
  104.  
  105. ipkg install bash
  106. ipkg install coreutils
  107. ipkg install man
  108.  
  109. 2) Add the symbolic link to bash in /bin with:
  110.  
  111. ln -s /opt/bin/bash /bin/bash
  112.  
  113. 3) Modify root's profile at ~/.profile to launch bash on log in by adding the following lines:
  114.  
  115. if [[ -x /bin/bash ]]; then
  116. echo Starting bash...
  117. exec /bin/bash
  118. fi
  119.  
  120. 4) Log in as root in a new window to confirm the changes work before closing your working window.
  121.  
  122. root@DiskStation:~ # echo $0
  123. /bin/bash
  124.  
  125. DragonSlay Installation
  126. ==============================================
  127.  
  128. ===============
  129. 03 INSTALL JIRA
  130. ===============
  131.  
  132. 1) Add a new jira user and group in /etc/passwd, /etc/group, /etc/shadow:
  133.  
  134. root@DiskStation:~ # vi /etc/passwd
  135. jira:x:147:147:JIRA:/opt/atlassian/jira:/bin/sh
  136.  
  137. root@DiskStation:~ # vi /etc/shadow
  138. jira:*:10933:0:99999:7:::
  139.  
  140. root@DiskStation:~ # vi /etc/group
  141. jira:x:147:jira
  142.  
  143. root@DiskStation:~ # mkdir /opt/atlassian/jira
  144. root@DiskStation:~ # mkdir /opt/atlassian/application-data
  145. root@DiskStation:~ # mkdir /opt/atlassian/application-data/jira
  146. root@DiskStation:~ # chown jira:jira /opt/atlassian/jira
  147. root@DiskStation:~ # chown jira:jira /opt/atlassian/application-data/jira
  148.  
  149. 2) Create the JIRA database and database user in PostgreSQL:
  150.  
  151. root@DiskStation:~ # su - postgres
  152.  
  153. BusyBox v1.16.1 (2015-01-07 15:00:31 CST) built-in shell (ash)
  154. Enter 'help' for a list of built-in commands.
  155.  
  156. DiskStation> /usr/syno/pgsql/bin/createuser -P jiradbuser
  157. Enter password for new role:
  158. Enter it again:
  159.  
  160. DiskStation> /usr/syno/pgsql/bin/createdb -E UTF8 -T template0 -O jiradbuser jira
  161.  
  162. DiskStation> vi /etc/postgresql/pg_hba.conf
  163. # TYPE DATABASE USER ADDRESS METHOD
  164. local all all trust
  165. host all all 127.0.0.1/32 trust
  166. host all all ::1/128 trust
  167. host jira all 16.1.1.1/24 trust
  168.  
  169. DiskStation> /usr/syno/pgsql/bin/pg_ctl reload
  170. server signaled
  171.  
  172. DiskStation> exit
  173.  
  174. Now connect via phpPgAdmin and log in as the jiradbuser account to confirm it's working.
  175.  
  176. 3) JIRA Installation
  177.  
  178. root@DiskStation:~ # su – jira
  179. DiskStation> cd /opt/atlassian/jira/
  180.  
  181. Download the linux atlassian-jira-6.3.13-x32.bin to the /opt/atlassian/jira/ directory.
  182.  
  183. DiskStation> chmod 700 atlassian-jira-6.3.13-x32.bin
  184.  
  185. Try to execute it with:
  186.  
  187. DiskStation> ./atlassian-jira-6.3.13-x32.bin
  188.  
  189. It will ask: You do not have administrator rights to this machine. This means... Press Y
  190. Also, the network ports JIRA wants to use by default are already used, so I used 8180 and 8105 for the new ports.
  191.  
  192. DiskStation> ./atlassian-jira-6.3.13-x32.bin
  193. Unpacking JRE ...
  194. Starting Installer ...
  195. Jan 16, 2015 4:42:49 PM java.util.prefs.FileSystemPreferences$2 run
  196. INFO: Created system preferences directory in java.home.
  197. You do not have administrator rights to this machine and as such, some installation options will not be available. Are you sure you want to continue?
  198. Yes [y, Enter], No [n]
  199. y
  200.  
  201. This will install JIRA 6.3.13 on your computer.
  202. OK [o, Enter], Cancel [c]
  203. o
  204. Choose the appropriate installation or upgrade option.
  205. Please choose one of the following:
  206. Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3]
  207. 2
  208.  
  209. Where should JIRA 6.3.13 be installed?
  210. [/opt/atlassian/jira/atlassian/jira]
  211. /opt/atlassian/jira
  212. Default location for JIRA data
  213. [/opt/atlassian/jira/atlassian/application-data/jira]
  214. /opt/atlassian/application-data/jira
  215. Configure which ports JIRA will use.
  216. JIRA requires two TCP ports that are not being used by any other
  217. applications on this machine. The HTTP port is where you will access JIRA
  218. through your browser. The Control port is used to Startup and Shutdown JIRA.
  219. Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
  220. 2
  221. HTTP Port Number
  222. [8080]
  223. 8180
  224. Control Port Number
  225. [8005]
  226. 8105
  227.  
  228. Extracting files ...
  229.  
  230. Please wait a few moments while JIRA starts up.
  231. Launching JIRA ...
  232. Installation of JIRA 6.3.13 is complete
  233. Your installation of JIRA 6.3.13 is now ready and can be accessed via your
  234. browser.
  235. JIRA 6.3.13 can be accessed at http://localhost:8180
  236. Finishing installation ...
  237.  
  238. Point Firefox at http://16.1.1.3:8180
  239.  
  240. 4) Set up JIRA Startup and Shutdown scripts
  241.  
  242. ?? /opt/etc/init.d/
  243.  
  244. DiskStation> vi /opt/atlassian/jira/bin/user.sh
  245.  
  246. # START INSTALLER MAGIC ! DO NOT EDIT !
  247. JIRA_USER="jira" ##
  248. # END INSTALLER MAGIC ! DO NOT EDIT !
  249.  
  250. export JIRA_USER
  251.  
  252. root@DiskStation:~ # vi /usr/local/etc/rc.d/S95jira.sh
  253.  
  254. #!/opt/bin/bash
  255. # Adjust bash path for Synology
  256.  
  257. # JIRA Linux Server Control Script
  258. cd "/opt/atlassian/jira/bin"
  259.  
  260. case "$1" in
  261. Start)
  262. ./start-jira.sh
  263. ;;
  264. stop)
  265. ./stop-jira.sh
  266. ;;
  267. *)
  268. echo "Usage: $0 {start|stop}"
  269. exit 1
  270. ;;
  271. esac
  272.  
  273. root@DiskStation:~ # chmod +x /usr/local/etc/rc.d/S95jira.sh
  274.  
  275. root@DiskStation:~ # vi /opt/atlassian/jira/bin/start-jira.sh
  276.  
  277. #!/opt/bin/bash
  278. # Adjust bash path for Synology
  279.  
  280. # resolve links - $0 may be a softlink - stolen from catalina.sh
  281. PRG="$0"
  282. while [ -h "$PRG" ]; do
  283. ls=`ls -ld "$PRG"`
  284. link=`expr "$ls" : '.*-> \(.*\)$'`
  285. if expr "$link" : '/.*' > /dev/null; then
  286. PRG="$link"
  287. else
  288. PRG=`dirname "$PRG"`/"$link"
  289. fi
  290. done
  291. PRGDIR=`dirname "$PRG"`
  292.  
  293. PRGRUNMODE=false
  294. if [ "$1" = "-fg" ] || [ "$1" = "run" ] ; then
  295. shift
  296. PRGRUNMODE=true
  297. else
  298. echo ""
  299. echo "To run JIRA in the foreground, start the server with start-jira.sh -fg"
  300. fi
  301. . `dirname $0`/user.sh #read in the user name
  302. if [ -z "$JIRA_USER" ] || [ $(id -un) == "$JIRA_USER" ]; then
  303. echo executing as current user
  304. if [ "$PRGRUNMODE" == "true" ] ; then
  305. exec $PRGDIR/catalina.sh run $@
  306. else
  307. exec $PRGDIR/startup.sh $@
  308. fi
  309. elif [ $UID -ne 0 ]; then
  310. echo JIRA has been installed to run as $JIRA_USER so please sudo run this to enable switching to that user
  311. exit 1
  312. else
  313. echo executing using dedicated user: $JIRA_USER
  314. if [ -x "/sbin/runuser" ]; then
  315. sucmd="/sbin/runuser"
  316. else
  317. sucmd="/opt/bin/su" # Adjust path for Synology
  318. fi
  319.  
  320. if [ "$PRGRUNMODE" == "true" ] ; then
  321. $sucmd -m $JIRA_USER -c "$PRGDIR/catalina.sh run $@"
  322. else
  323. $sucmd -m $JIRA_USER -c "$PRGDIR/startup.sh $@"
  324. fi
  325. fi
  326.  
  327.  
  328. root@DiskStation:~ # vi /opt/atlassian/jira/bin/stop-jira.sh
  329.  
  330. #!/opt/bin/bash
  331. # Adjust bash path for Synology
  332.  
  333. # resolve links - $0 may be a softlink - stolen from catalina.sh
  334. PRG="$0"
  335. while [ -h "$PRG" ]; do
  336. ls=`ls -ld "$PRG"`
  337. link=`expr "$ls" : '.*-> \(.*\)$'`
  338. if expr "$link" : '/.*' > /dev/null; then
  339. PRG="$link"
  340. else
  341. PRG=`dirname "$PRG"`/"$link"
  342. fi
  343. done
  344. PRGDIR=`dirname "$PRG"`
  345.  
  346. . `dirname $0`/user.sh #readin the username
  347.  
  348. if [ -z "$JIRA_USER" ] || [ $(id -un) == "$JIRA_USER" ]; then
  349. echo executing as current user
  350. exec $PRGDIR/shutdown.sh 20 -force $@
  351. elif [ $UID -ne 0 ]; then
  352. echo JIRA has been installed to run as $JIRA_USER so please sudo run this to enable switching to that user
  353. exit 1
  354. else
  355. echo executing using dedicated user
  356. if [ -x "/sbin/runuser" ]; then
  357. sucmd="/sbin/runuser"
  358. else
  359. sucmd="/opt/bin/su" # Adjust path for Synology
  360. fi
  361. $sucmd -m $JIRA_USER -c "$PRGDIR/shutdown.sh 20 -force $@"
  362. fi
  363.  
  364. ===============
  365. 04 INSTALL CONFLUENCE
  366. ===============
  367.  
  368. 1) Add a new confluence user and group in /etc/passwd, /etc/group, /etc/shadow:
  369.  
  370. root@DiskStation:~ # vi /etc/passwd
  371. confluence:x:148:148:CONFLUENCE:/opt/atlassian/confluence:/bin/sh
  372.  
  373. root@DiskStation:~ # vi /etc/shadow
  374. confluence:*:10933:0:99999:7:::
  375.  
  376. root@DiskStation:~ # vi /etc/group
  377. confluence:x:148:confluence
  378.  
  379. root@DiskStation:~ # mkdir /opt/atlassian/confluence
  380. root@DiskStation:~ # mkdir /opt/atlassian/application-data/confluence
  381. root@DiskStation:~ # chown confluence:confluence /opt/atlassian/confluence
  382. root@DiskStation:~ # chown confluence:confluence /opt/atlassian/application-data/confluence
  383.  
  384. 2) Create the Confluence database and database user in PostgreSQL:
  385.  
  386. root@DiskStation:~ # su - postgres
  387.  
  388. BusyBox v1.16.1 (2015-01-07 15:00:31 CST) built-in shell (ash)
  389. Enter 'help' for a list of built-in commands.
  390.  
  391. DiskStation> /usr/syno/pgsql/bin/createuser -P confdbuser
  392. Enter password for new role:
  393. Enter it again:
  394.  
  395. DiskStation> /usr/syno/pgsql/bin/createdb -E UTF8 -T template0 -O confdbuser confluence
  396.  
  397. DiskStation> vi /etc/postgresql/pg_hba.conf
  398. # TYPE DATABASE USER ADDRESS METHOD
  399. local all all trust
  400. host all all 127.0.0.1/32 trust
  401. host all all ::1/128 trust
  402. host jira all 16.1.1.1/24 trust
  403. host confluence all 16.1.1.1/24 trust
  404.  
  405. DiskStation> /usr/syno/pgsql/bin/pg_ctl reload
  406. server signaled
  407.  
  408. DiskStation> exit
  409.  
  410. 3) Confluence Installation
  411.  
  412. root@DiskStation:/opt/atlassian/confluence # su - confluence
  413.  
  414. BusyBox v1.16.1 (2015-01-07 15:00:31 CST) built-in shell (ash)
  415. Enter 'help' for a list of built-in commands.
  416.  
  417. DiskStation> ls
  418. atlassian-confluence-5.6.5-x32.bin
  419. DiskStation> ./atlassian-confluence-5.6.5-x32.bin
  420. Unpacking JRE ...
  421. Starting Installer ...
  422. Jan 18, 2015 2:16:52 PM java.util.prefs.FileSystemPreferences$1 run
  423. INFO: Created user preferences directory.
  424. Jan 18, 2015 2:16:52 PM java.util.prefs.FileSystemPreferences$2 run
  425. INFO: Created system preferences directory in java.home.
  426. You do not have administrator rights to this machine and as such, some installation options will not be available. Are you sure you want to continue?
  427. Yes [y, Enter], No [n]
  428. y
  429.  
  430. This will install Confluence 5.6.5 on your computer.
  431. OK [o, Enter], Cancel [c]
  432.  
  433. Choose the appropriate installation or upgrade option.
  434. Please choose one of the following:
  435. Express Install (uses default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing Confluence installation [3]
  436. 2
  437.  
  438. Where should Confluence 5.6.5 be installed?
  439. [/opt/atlassian/confluence/atlassian/confluence]
  440. /opt/atlassian/confluence
  441. Default location for Confluence data
  442. [/opt/atlassian/confluence/atlassian/application-data/confluence]
  443. /opt/atlassian/application-data/confluence
  444. Configure which ports Confluence will use.
  445. Confluence requires two TCP ports that are not being used by any other
  446. applications on this machine. The HTTP port is where you will access
  447. Confluence through your browser. The Control port is used to Startup and
  448. Shutdown Confluence.
  449. Use default ports (HTTP: 8090, Control: 8000) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
  450. 2
  451. HTTP Port Number
  452. [8090]
  453. 8190
  454. Control Port Number
  455. [8000]
  456. 8100
  457.  
  458. Extracting files ...
  459.  
  460. Please wait a few moments while Confluence starts up.
  461. Launching Confluence ...
  462. Installation of Confluence 5.6.5 is complete
  463. Your installation of Confluence 5.6.5 is now ready and can be accessed via
  464. your browser.
  465. Confluence 5.6.5 can be accessed at http://localhost:8190
  466. Finishing installation ...
  467.  
  468. Stop Confluence...
  469.  
  470. DiskStation> bin/stop-confluence.sh
  471.  
  472. DiskStation> vi bin/user.sh
  473.  
  474. # START INSTALLER MAGIC ! DO NOT EDIT !
  475. CONF_USER="confluence" ##
  476. # END INSTALLER MAGIC ! DO NOT EDIT !
  477.  
  478. export CONF_USER
  479.  
  480. Point Firefox at http://16.1.1.3:8190/confluence
  481.  
  482. 4) Set up Confluence Startup and Shutdown scripts
  483.  
  484. #!/opt/bin/bash
  485. # Adjust bash path for Synology
  486.  
  487. # Confluence Linux Server Control Script
  488. # Set private environment
  489.  
  490. JAVA_HOME=”/opt/java”
  491. PATH=$PATH:/opt/java/bin
  492.  
  493. export JAVA_HOME PATH
  494.  
  495. cd "/opt/atlassian/confluence/bin"
  496.  
  497. case "$1" in
  498. Start)
  499. /opt/bin/su -m confluence -c./startup.sh
  500. ;;
  501. stop)
  502. /opt/bin/su -m confluence -c./shutdown.sh
  503. ;;
  504. *)
  505. echo "Usage: $0 {start|stop}"
  506. exit 1
  507. ;;
  508. esac
  509.  
  510.  
  511. ===============
  512. A1 DragonSlay Installation Research Notes
  513. ===============
  514.  
  515. References:
  516. A partial write up of an early Atlassian DragonSlay on a Synology DS1511+
  517. https://webselblog.wordpress.com/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement