ramverma | af74a62 | 2018-07-31 18:25:39 +0100 | [diff] [blame^] | 1 | // |
| 2 | // ============LICENSE_START======================================================= |
| 3 | // Copyright (C) 2016-2018 Ericsson. All rights reserved. |
| 4 | // ================================================================================ |
| 5 | // This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE |
| 6 | // Full license text at https://creativecommons.org/licenses/by/4.0/legalcode |
| 7 | // |
| 8 | // SPDX-License-Identifier: CC-BY-4.0 |
| 9 | // ============LICENSE_END========================================================= |
| 10 | // |
| 11 | // @author Sven van der Meer (sven.van.der.meer@ericsson.com) |
| 12 | // |
| 13 | |
| 14 | == Install APEX |
| 15 | APEX can be installed in different ways: |
| 16 | |
| 17 | - Unix: automatically using `rpm` or `dpkg` from `.rpm` or `.deb` archive |
| 18 | - Windows, Unix, Cygwin: manually from a `.tar.gz` archive |
| 19 | - Windows, Unix, Cygwin: build from source using Maven, then install manually |
| 20 | |
| 21 | |
| 22 | === Install with RPM and DPKG |
| 23 | The install distributions of APEX automatically install the system. |
| 24 | The installation directory is `/opt/ericsson/apex`. |
| 25 | Log files are located in `/var/log/ericsson/apex`. |
| 26 | The latest APEX version will be available as `/opt/ericsson/apex/apex`. |
| 27 | |
| 28 | For the installation, a new user `apexuser` and a new group `apexuser` will be created. |
| 29 | This user owns the installation directories and the log file location. |
| 30 | The user is also used by the standard APEX start scripts to run APEX with this user's permissions. |
| 31 | |
| 32 | [width="100%",options="header",cols="a"] |
| 33 | |==================== |
| 34 | | RPM Installation |
| 35 | | |
| 36 | [source%nowrap,sh,numbered,subs="attributes+"] |
| 37 | ---- |
| 38 | # sudo rpm -i apex-apps.uservice-packages-{release-version}-full.rpm |
| 39 | ********************preinst******************* |
| 40 | arguments 1 |
| 41 | ********************************************** |
| 42 | creating group apexuser . . . |
| 43 | creating user apexuser . . . |
| 44 | ********************postinst**************** |
| 45 | arguments 1 |
| 46 | *********************************************** |
| 47 | ---- |
| 48 | |==================== |
| 49 | |
| 50 | |
| 51 | [width="100%",options="header",cols="a"] |
| 52 | |==================== |
| 53 | | DPKG Installation |
| 54 | | |
| 55 | [source%nowrap,sh,numbered,subs="attributes+"] |
| 56 | ---- |
| 57 | # sudo dpkg -i apex-apps.uservice-packages-{release-version}-full.deb |
| 58 | Selecting previously unselected package apex-uservice. |
| 59 | (Reading database ... 288458 files and directories currently installed.) |
| 60 | Preparing to unpack apex-apps.uservice-packages-{release-version}-full.deb ... |
| 61 | ********************preinst******************* |
| 62 | arguments install |
| 63 | ********************************************** |
| 64 | creating group apexuser . . . |
| 65 | creating user apexuser . . . |
| 66 | Unpacking apex-uservice ({release-version}) ... |
| 67 | Setting up apex-uservice ({release-version}) ... |
| 68 | ********************postinst**************** |
| 69 | arguments configure |
| 70 | *********************************************** |
| 71 | ---- |
| 72 | |==================== |
| 73 | |
| 74 | Once the installation is finished, APEX is fully installed and ready to run. |
| 75 | |
| 76 | |
| 77 | === Install Manually from Archive (Unix, Cygwin) |
| 78 | Download a `tar.gz` archive. |
| 79 | Create a directory where APEX should be installed. |
| 80 | Extract the `tar` archive. |
| 81 | The following example shows how to install APEX in `/opt/apex` and create a link to `/opt/apex/apex` for the most recent installation. |
| 82 | |
| 83 | [source%nowrap,sh,numbered,subs="attributes+"] |
| 84 | ---- |
| 85 | # cd /opt |
| 86 | # mkdir apex |
| 87 | # cd apex |
| 88 | # mkdir apex-full-{release-version} |
| 89 | # tar xvfz ~/Downloads/apex-apps.uservice-packages-{release-version}-full.tar.gz -C apex-full-{release-version} |
| 90 | # ln -s apex apex-apps.uservice-packages-{release-version} |
| 91 | ---- |
| 92 | |
| 93 | |
| 94 | === Install Manually from Archive (Windows, 7Zip, GUI) |
| 95 | Download a `tar.gz` archive and copy the file into the install folder (in this example `C:\apex`). |
| 96 | Assuming you are using 7Zip, right click on the file and extract the `tar` archive. |
| 97 | Note: the screenshots might show an older version than you have. |
| 98 | |
| 99 | image::install-guide/win-extract-tar-gz.png[Extract the TAR archive] |
| 100 | |
| 101 | The right-click on the new created TAR file and extract the actual APEX distribution. |
| 102 | |
| 103 | image::install-guide/win-extract-tar.png[Extract the APEX distribution] |
| 104 | |
| 105 | Inside the new APEX folder you see the main directories: `bin`, `etc`, `examples`, `lib`, and `war` |
| 106 | |
| 107 | image::install-guide/win-extracted.png[Extracted APEX distribution] |
| 108 | |
| 109 | Once extracted, please rename the created folder to `apex-full-{release-version}`. |
| 110 | This will keep the directory name in line with the rest of this documentation. |
| 111 | |
| 112 | |
| 113 | === Install Manually from Archive (Windows, 7Zip, CMD) |
| 114 | Download a `tar.gz` archive and copy the file into the install folder (in this example `C:\apex`). |
| 115 | Start `cmd`, for instance typing `Windows+R` and then `cmd` in the dialog. |
| 116 | Assuming `7Zip` is installed in the standard folder, simply run the following commands (for APEX version {release-version} full distribution) |
| 117 | |
| 118 | [source%nowrap,bat,numbered,subs="attributes+"] |
| 119 | ---- |
| 120 | >c: |
| 121 | >cd \apex |
| 122 | >"\Program Files\7-Zip\7z.exe" x apex-apps.uservice-packages-{release-version}-full.tar.gz -so | "\Program Files\7-Zip\7z.exe" x -aoa -si -ttar -o"apex-full-{release-version}" |
| 123 | ---- |
| 124 | |
| 125 | APEX is now installed in the folder `C:\apex\apex-full-{release-version}`. |
| 126 | |
| 127 | |
| 128 | |
| 129 | == Build from Source |
| 130 | |
| 131 | === Build and Install Manually (Unix, Windows, Cygwin) |
| 132 | Clone the APEX GIT repositories into a directory. |
| 133 | Go to that directory. |
| 134 | Use Maven to build APEX (all details on building APEX from source can be found in __APEX HowTo: Build__). |
| 135 | Install from the created artifacts (`rpm`, `deb`, `tar.gz`, or copying manually). |
| 136 | |
| 137 | [IMPORTANT] |
| 138 | .Building RPM distributions |
| 139 | ==== |
| 140 | RPM images are only build if the `rpm` package is installed (Unix). |
| 141 | To install `rpm` run `sudo apt-get install rpm`, then build APEX. |
| 142 | ==== |
| 143 | |
| 144 | The following example shows how to build the APEX system, without tests (`-DskipTests`) to safe some time. |
| 145 | It assumes that the APX GIT repositories are cloned to: |
| 146 | |
| 147 | - Unix, Cygwin: `/usr/local/src/apex` |
| 148 | - Windows: `C:\dev\apex` |
| 149 | |
| 150 | |
| 151 | [width="100%",options="header",cols="5a,5a"] |
| 152 | |==================== |
| 153 | | Unix, Cygwin | Windows |
| 154 | | |
| 155 | [source%nowrap,sh,numbered] |
| 156 | ---- |
| 157 | # cd /usr/local/src/apex |
| 158 | # mvn clean install -DskipTests |
| 159 | ---- |
| 160 | | |
| 161 | [source%nowrap,bat,numbered] |
| 162 | ---- |
| 163 | >c: |
| 164 | >cd \dev\apex |
| 165 | >mvn clean install -DskipTests |
| 166 | ---- |
| 167 | |==================== |
| 168 | |
| 169 | The build takes about 2 minutes without test and about 4-5 minutes with tests on a standard development laptop. |
| 170 | It should run through without errors, but with a lot of messages from the build process. |
| 171 | If build with tests (i.e. without `-DskipTests`), there will be error messages and stack trace prints from some tests. |
| 172 | This is normal, as long as the build finishes successful. |
| 173 | |
| 174 | When Maven is finished with the build, the final screen should look similar to this (omitting some `success` lines): |
| 175 | |
| 176 | [source%nowrap,sh,numbered,subs="attributes+"] |
| 177 | ---- |
| 178 | include::{adsite-main-dir}/site-docs/adoc/fragments/screens/mvn-install-skiptests.txt[mvn build, no tests] |
| 179 | ---- |
| 180 | |
| 181 | |
| 182 | The build will have created all artifacts required for an APEX installation. |
| 183 | The following example show how to change to the target directory and how it should look like. |
| 184 | |
| 185 | [width="100%",options="header",cols="a"] |
| 186 | |==================== |
| 187 | | Unix, Cygwin |
| 188 | | |
| 189 | [source%nowrap,sh,numbered] |
| 190 | ---- |
| 191 | # cd modules/apex-apps/apex-apps.uservice/apex-apps.uservice-packaging/apex-apps.uservice-package-full/target |
| 192 | # ls -l |
| 193 | ---- |
| 194 | |
| 195 | | |
| 196 | [source%nowrap,sh,numbered,subs="attributes+"] |
| 197 | ---- |
| 198 | include::{adsite-main-dir}/site-docs/adoc/fragments/screens/target-ls-unix.txt[successful build, ls, unix] |
| 199 | ---- |
| 200 | |
| 201 | |
| 202 | |==================== |
| 203 | |
| 204 | |
| 205 | [width="100%",options="header",cols="a"] |
| 206 | |==================== |
| 207 | | Windows |
| 208 | | |
| 209 | [source%nowrap,bat,numbered] |
| 210 | ---- |
| 211 | >cd modules\apex-apps\apex-apps.uservice\apex-apps.uservice-packaging\apex-apps.uservice-package-full\target |
| 212 | >dir |
| 213 | ---- |
| 214 | |
| 215 | | |
| 216 | [source%nowrap,sh,numbered,subs="attributes+"] |
| 217 | ---- |
| 218 | include::{adsite-main-dir}/site-docs/adoc/fragments/screens/target-ls-win.txt[successful build, ls, windows] |
| 219 | ---- |
| 220 | |
| 221 | |
| 222 | |==================== |
| 223 | |
| 224 | Now, take the `.deb` or the `.tar.gz` file and install APEX. |
| 225 | Alternatively, copy the content of the folder `install_hierarchy` to your APEX directory. |
| 226 | |