blob: a1e95347aa0ee4011d10244e363823769024f2aa [file] [log] [blame]
ramvermaaf74a622018-07-31 18:25:39 +01001//
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
15APEX 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
23The install distributions of APEX automatically install the system.
24The installation directory is `/opt/ericsson/apex`.
25Log files are located in `/var/log/ericsson/apex`.
26The latest APEX version will be available as `/opt/ericsson/apex/apex`.
27
28For the installation, a new user `apexuser` and a new group `apexuser` will be created.
29This user owns the installation directories and the log file location.
30The 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*******************
40arguments 1
41**********************************************
42creating group apexuser . . .
43creating user apexuser . . .
44********************postinst****************
45arguments 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
58Selecting previously unselected package apex-uservice.
59(Reading database ... 288458 files and directories currently installed.)
60Preparing to unpack apex-apps.uservice-packages-{release-version}-full.deb ...
61********************preinst*******************
62arguments install
63**********************************************
64creating group apexuser . . .
65creating user apexuser . . .
66Unpacking apex-uservice ({release-version}) ...
67Setting up apex-uservice ({release-version}) ...
68********************postinst****************
69arguments configure
70***********************************************
71----
72|====================
73
74Once the installation is finished, APEX is fully installed and ready to run.
75
76
77=== Install Manually from Archive (Unix, Cygwin)
78Download a `tar.gz` archive.
79Create a directory where APEX should be installed.
80Extract the `tar` archive.
81The 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)
95Download a `tar.gz` archive and copy the file into the install folder (in this example `C:\apex`).
96Assuming you are using 7Zip, right click on the file and extract the `tar` archive.
97Note: the screenshots might show an older version than you have.
98
99image::install-guide/win-extract-tar-gz.png[Extract the TAR archive]
100
101The right-click on the new created TAR file and extract the actual APEX distribution.
102
103image::install-guide/win-extract-tar.png[Extract the APEX distribution]
104
105Inside the new APEX folder you see the main directories: `bin`, `etc`, `examples`, `lib`, and `war`
106
107image::install-guide/win-extracted.png[Extracted APEX distribution]
108
109Once extracted, please rename the created folder to `apex-full-{release-version}`.
110This will keep the directory name in line with the rest of this documentation.
111
112
113=== Install Manually from Archive (Windows, 7Zip, CMD)
114Download a `tar.gz` archive and copy the file into the install folder (in this example `C:\apex`).
115Start `cmd`, for instance typing `Windows+R` and then `cmd` in the dialog.
116Assuming `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
125APEX 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)
132Clone the APEX GIT repositories into a directory.
133Go to that directory.
134Use Maven to build APEX (all details on building APEX from source can be found in __APEX HowTo: Build__).
135Install from the created artifacts (`rpm`, `deb`, `tar.gz`, or copying manually).
136
137[IMPORTANT]
138.Building RPM distributions
139====
140RPM images are only build if the `rpm` package is installed (Unix).
141To install `rpm` run `sudo apt-get install rpm`, then build APEX.
142====
143
144The following example shows how to build the APEX system, without tests (`-DskipTests`) to safe some time.
145It 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
169The build takes about 2 minutes without test and about 4-5 minutes with tests on a standard development laptop.
170It should run through without errors, but with a lot of messages from the build process.
171If build with tests (i.e. without `-DskipTests`), there will be error messages and stack trace prints from some tests.
172This is normal, as long as the build finishes successful.
173
174When 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----
178include::{adsite-main-dir}/site-docs/adoc/fragments/screens/mvn-install-skiptests.txt[mvn build, no tests]
179----
180
181
182The build will have created all artifacts required for an APEX installation.
183The 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----
198include::{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----
218include::{adsite-main-dir}/site-docs/adoc/fragments/screens/target-ls-win.txt[successful build, ls, windows]
219----
220
221
222|====================
223
224Now, take the `.deb` or the `.tar.gz` file and install APEX.
225Alternatively, copy the content of the folder `install_hierarchy` to your APEX directory.
226