back-end (the http server) and front-end (the html and javascript code for the browsers) are both built when the build of the `websrv` optional library is requested.
back-end (the http server) and front-end (the html and javascript code for the browsers) are both built when the build of the `websrv` optional library is requested.
You can include the web server interface components in your build using the build_oai script with the `--build-lib "telnetsrv websrv"` option.
You can include the web server interface components in your build using the `build_oai` script with the `--build-lib "telnetsrv websrv"` option.
The related cmake cache entry in `ran_build/build/CMakeCache.txt` for building the web server
The related cmake cache entry in `ran_build/build/CMakeCache.txt` for building the web server
is `ENABLE_WEBSRV:BOOL=ON`
is `ENABLE_WEBSRV:BOOL=ON`
When cmake configuration has been completed, with websrv enabled and all dependencies met,font-end and back-end
When cmake configuration has been completed, with websrv enabled and all dependencies met,font-end and back-end
can be built separately, using respectively `make websrvfront` or `make websrv` from the build repository (replace make by ninja if you
can be built separately, using respectively `make websrvfront` or `make websrv` from the build repository (replace make by ninja if you
build using ninja).
build using ninja).
## Additional dependencies for the backend
To build the webserver frontend, you need additionally
###### build example when back-end dependency is not installed
1. the [ulfius library](https://github.com/babelouest/ulfius)
2. the [jansson library](https://github.com/akheron/jansson-debian)
-- Ccache not found. Consider installing it for faster compilation. Command: sudo apt/dnf install ccache
-- Check if /opt/asn1c/bin/asn1c supports -gen-APER
-- Check if /opt/asn1c/bin/asn1c supports -no-gen-UPER
-- Check if /opt/asn1c/bin/asn1c supports -no-gen-JER
-- Check if /opt/asn1c/bin/asn1c supports -no-gen-BER
-- Check if /opt/asn1c/bin/asn1c supports -no-gen-OER
-- CMAKE_BUILD_TYPE is RelWithDebInfo
-- CPUARCH x86_64
-- AVX512 intrinsics are OFF
-- AVX2 intrinsics are ON
-- Checking for module 'cblas'
-- No package 'cblas' found
-- Add enb specific telnet functions in libtelnetsrv_enb.so
-- No specific telnet functions for gnb
-- No specific telnet functions for 4Gue
-- Add 5Gue specific telnet functions in libtelnetsrv_5Gue.so
-- Add CI specific telnet functions in libtelnetsrv_ci.so
-- found libulfius for websrv
-- found libjansson for websrv
CMake Error at common/utils/websrv/CMakeLists.txt:45 (find_program):
Could not find NPM using the following names: npm
### Fedora(-based OS)
-- Configuring incomplete, errors occurred!
```bash
See also "/usr/local/oai/develop_unmodified/openairinterface5g/cmake_targets/ran_build/build/CMakeFiles/CMakeOutput.log".
$ sudo dnf update -y
build have failed
$ sudo dnf install-y jansson-devel npm curl wget
```
```
Currently the web server frontend can run with nodejs 18, you can check the version (if any) installed on your system entering the `node -v` command.
To prevent difficult situations with nodejs or npm versions it is better to specifically install the required nodejs version (after removing existing versions of npm and nodejs), as explained
ulfius has to be installed as explained [here](https://github.com/babelouest/ulfius/blob/master/INSTALL.md#pre-compiled-packages).
[here](https://www.stewright.me/2023/04/install-nodejs-18-on-ubuntu-22-04/) for ubuntu. Similar instructions can be found for other distributions.
It is also possible to make several nodejs versions co-habiting on your system, this is beyond this doc.
## Additional dependencies for the frontend
###### example: installing nodejs 18 on ubuntu
Currently the web server frontend can run with nodejs 18, you can check the
```
version (if any) installed on your system entering the `node -v` command.
When starting the softmodem, you must specify the **_\-\-websrv_** option to load and start the web server. The web server is loaded via the [oai shared library loader](loader).
# Testing the web server interface
# Running the web server interface
When starting the softmodem, you must specify the `--websrv` option to load and start the web server. The web server is loaded via the [oai shared library loader](loader).
## web server parameters
## web server parameters
The web server back-end is using the [oai configuration module](Config/Rtusage). web server parameters must be specified in the websrv section.
The web server back-end is using the [oai configuration module](Config/Rtusage). web server parameters must be specified in the websrv section.
...
@@ -367,7 +249,7 @@ The web server back-end is using the [oai configuration module](Config/Rtusage).
...
@@ -367,7 +249,7 @@ The web server back-end is using the [oai configuration module](Config/Rtusage).
| | | | |
| | | | |
## running the back-end
## running the back-end
To trigger the back-end use the `--websrv` option, possibly modifying the parameters as explained in the previous chapter. The two following commands allow starting the oai gNB and the oai 5G UE on the same computer, starting the telnet server and the web interface on both executables.
To trigger the back-end use the `--websrv` option, possibly modifying the parameters as explained in the [previous section](./websrvuse.md#web-server-parameters). The two following commands allow starting the oai gNB and the oai 5G UE on the same computer, starting the telnet server and the web interface on both executables.