Closed davidjwbbc closed 2 weeks ago
Changes look good, @davidjwbbc .
In addition, would it be possible to print out some informative lines to the console to confirm which paths have been detected for the binary and modules? This is then valuable feedback for the user to understand what's going on when there are multiple instances installed at different paths.
Added log output to log INFO messages about the path and mime.types file location. For example:
INFO:rt-5gms-as:Found OpenResty path at /usr/local/openresty/nginx/sbin, will try this path first for nginx executable location
INFO:NginxWebProxy:Found mime.types file at /usr/local/openresty/nginx/conf/mime.types
[2024-06-11 11:52:21 +0100] [10512] [INFO] Running on http://127.0.0.1:7777 (CTRL + C to quit)
INFO:hypercorn.error:Running on http://127.0.0.1:7777 (CTRL + C to quit)
Hi David, I've reinstalled from your branch and I keep getting the lua_package_path error:
fivegmag@5GMAG-NUC:~/rt-5gms-application-server$ sudo 5gms-application-server
INFO:NginxWebProxy:Found mime.types file at /etc/nginx/mime.types
[2024-06-14 11:22:04 +0200] [3394050] [INFO] Running on http://127.0.0.1:7777 (CTRL + C to quit)
INFO:hypercorn.error:Running on http://127.0.0.1:7777 (CTRL + C to quit)
INFO:NginxWebProxy:
ERROR:NginxWebProxy:nginx: [emerg] unknown directive "lua_package_path" in /tmp/rt_5gms_as.conf:48
INFO:rt-5gms-as:Web proxy process exited, has been restarted
INFO:NginxWebProxy:
ERROR:NginxWebProxy:nginx: [emerg] unknown directive "lua_package_path" in /tmp/rt_5gms_as.conf:48
INFO:rt-5gms-as:Web proxy process exited, has been restarted
INFO:NginxWebProxy:
ERROR:NginxWebProxy:nginx: [emerg] unknown directive "lua_package_path" in /tmp/rt_5gms_as.conf:48
INFO:rt-5gms-as:Web proxy process exited, has been restarted
INFO:NginxWebProxy:
ERROR:NginxWebProxy:nginx: [emerg] unknown directive "lua_package_path" in /tmp/rt_5gms_as.conf:48
INFO:rt-5gms-as:Web proxy process exited, has been restarted
INFO:NginxWebProxy:
ERROR:NginxWebProxy:nginx: [emerg] unknown directive "lua_package_path" in /tmp/rt_5gms_as.conf:48
INFO:rt-5gms-as:Web proxy process exited, has been restarted
INFO:NginxWebProxy:
ERROR:NginxWebProxy:nginx: [emerg] unknown directive "lua_package_path" in /tmp/rt_5gms_as.conf:48
ERROR:rt-5gms-as:nginx web proxy restarting too quickly, aborting...
``
I believe it is useful that when doing a clean installation I make sure Openresty is installed... IGNORE the above. It works, now trying to disable nginx:
fivegmag@5GMAG-NUC:~/rt-5gms-application-server$ sudo 5gms-application-server
INFO:rt-5gms-as:Found OpenResty path at /usr/local/openresty/nginx/sbin, will try this path first for nginx executable location
INFO:NginxWebProxy:Found mime.types file at /usr/local/openresty/nginx/conf/mime.types
[2024-06-14 11:33:51 +0200] [3412561] [INFO] Running on http://127.0.0.1:7777 (CTRL + C to quit)
INFO:hypercorn.error:Running on http://127.0.0.1:7777 (CTRL + C to quit)
INFO:NginxWebProxy:
ERROR:NginxWebProxy:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
``
@davidjwbbc, after testing, I think we are good to go. My recollection on the instructions will be that the export PATH command is no longer needed and that systemctl disable --now nginx.service openresty.service
is still needed before execuding 5gms-application-server to avoid active instances
I would suggest to move the installation of Openresty upwards and make it a more explicit step. I would integrate the paragraph
Please note that the application server requires a suitable web proxy server to be installed. At present the only web proxy server that the application server can use is Openresty. This means you should install the openresty package on your distribution, instruction to do so can be found on the Openresty website for linux distributions and Microsoft Windows. The Openresty version of nginx should also be the first version on the system path.
within "Install dependencies" rather than under running (you will try to execute 5gms-application-server but the paragraph telling you to install openresty just comes next).
Ok, I've improved the OpenResty executable finding by verifying the nginx executable found was compiled to handle LUA.
If no suitable executable is found then the following error is displayed:
ERROR:rt-5gms-as:Please install at least one of: openresty
"openresty" being the only web proxy module currently implemented (renamed from "nginx" to avoid confusion). If more web proxy modules are added and none find their executables are found then they are all listed here.
If the openresty web proxy module found a suitable nginx executable then it is reported:
INFO:OpenRestyWebProxy:Found nginx executable supporting LUA at /usr/local/openresty/nginx/sbin/nginx
Note: I'm no longer adding the known openresty path to the PATH environment variable, instead the openresty web proxy module provides the known openresty path as an extra path to try to the function which finds executables. This allows the AS to be run with an alternative OpenResty in the PATH to use that one instead.
@davidjwbbc same as Richard. I cannot find the line in the app.py file of the PR. I see the correction if I go directly to your branch though. Somehow the PR is not up to date?
sorry, I see it now. Line 261 but somehow the change is not displayed by GitHub under "Files changed". I think this is good to go.
This PR includes some minor bug fixes for #83 and #89.
Find mime.types file (#83):
mime.types
file and then for the default nginxmime.types
file and use the foundmime.types
in the nginx configuration./usr/local/openresty/nginx/conf/mime.types
and/etc/nginx/mime.types
./usr/share/nginx/modules
being present (Openresty automatically includes its own modules so doesn't need this extra include in the nginx configuration).Automatically find Openresty path (#89):
nginx/sbin
directories and if found prepends it to thePATH
environment variable for the AS environment./usr/local/openresty/nginx/sbin
.Fixes #83 Fixes #89