I'm setting up a new OCS Server with the following configuration
Host: Windows Server 2022 with docker in WSL Mode (thanks docker desktop) with a compose mode.
version used: 2.11.0
First, I had to modify the compose file because the NGinx component doesn't make the bridge between himself and the OCS Server component. So I compose with this file
version: '3'
services:
ocsapplication:
image: ocsinventory/ocsinventory-docker-image:2.11
container_name : ocsinventory-server
restart: always
expose:
- "80"
ports:
- 80:80
- 443:443
volumes:
- "perlcomdata:/etc/ocsinventory-server"
- "ocsreportsdata:/usr/share/ocsinventory-reports/ocsreports/extensions"
- "varlibdata:/var/lib/ocsinventory-reports"
- "httpdconfdata:/etc/apache2/conf-available"
environment:
OCS_DB_SERVER: ocsinventory-db
OCS_DB_USER: ocsuser
OCS_DB_PASS: ocspass
OCS_DB_NAME: ocsweb
# See documentation to set up SSL for MySQL
OCS_SSL_ENABLED: 0
LISTEN_PORT: 80
links:
- ocsdb
networks:
- localocs
depends_on:
- ocsdb
ocsdb :
image : mysql:8.0
container_name : ocsinventory-db
restart: always
expose :
- "3306"
ports:
- 3306:3306
volumes :
- ./sql/:/docker-entrypoint-initdb.d/
- sqldata:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD : rootpass
MYSQL_USER : ocsuser
MYSQL_PASSWORD : ocspass
MYSQL_DATABASE : ocsweb
LISTEN_PORT: 3306
networks:
- localocs
# ocsproxy:
# image: nginx
# container_name: ocsinventory-proxy
# restart: always
# ports:
# - 80:80
# - 443:443
# volumes:
# - ./nginx/conf:/etc/nginx/templates
# - ./nginx/certs:/etc/nginx/certs
# - ./nginx/auth:/etc/nginx/auth
# environment:
# # 80 or 443
# LISTEN_PORT: 80
# # empty or ssl
# PORT_TYPE: ""
# SSL_CERT: ocs-dummy.crt
# SSL_KEY: ocs-dummy.key
# # OCS Api user restriction (default ocsapi/ocapi)
# API_AUTH_FILE: ocsapi.htpasswd
# # OCS Download
# READ_TIMEOUT: 300
# CONNECT_TIMEOUT: 300
# SEND_TIMEOUT: 300
# MAX_BODY_SIZE: 1G
# depends_on:
# - ocsapplication
# networks:
# - localocs
networks:
localocs:
volumes:
perlcomdata:
ocsreportsdata:
varlibdata:
httpdconfdata:
sqldata:
now, the compose is working but I have 2 errors in the building time and 1 in the production time
for the building:
[Tue Jan 31 15:22:54 2023] OCSINVENTORY: (SOAP): Cannot find XML::Entities
2023-01-31 15:22:54 ocsinventory-server: Can't load SOAP::Transport::HTTP* - Web service will be unavailable
Don't know if these are blocking issues. as I understand, the XML::Entities is not installed during the compose setup. for the SOAP transport, I have no idea where is the problem
now the production issue: I can't login to the main page of the administrative console, a PHP error is returned when I try to login
[php:error] [pid 100] [client 172.20.0.1:46598] PHP Fatal error: Uncaught TypeError: mysqli_fetch_object():
Argument #1 ($result) must be of type mysqli_result, bool given in /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/methode/local.php:29
Stack trace:
#0 /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/methode/local.php(29): mysqli_fetch_object()
#1 /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/auth.php(90): require_once('...')
#2 /usr/share/ocsinventory-reports/ocsreports/require/header.php(321): require_once('...')
#3 /usr/share/ocsinventory-reports/ocsreports/index.php(44): require('...')\
4 {main}\n thrown in /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/methode/local.php on line 29, referer: http://<insert servername here>/ocsreports/
any clues?
regards