multiOTP / multiotp

multiOTP open source strong two factor authentication PHP library, OATH certified, with TOTP, HOTP, Mobile-OTP, YubiKey, SMS, QRcode provisioning, etc.
http://www.multiOTP.net/
GNU Lesser General Public License v3.0
358 stars 76 forks source link

502 Bad Gateway #181

Closed prosaugat closed 10 months ago

prosaugat commented 10 months ago

I have set up both Windows AD and multiOTP on my Windows Server 2019. I have successfully configured it, but I am unable to open the webpage of the multiOTP server. I am getting a "502 Bad Gateway" error when attempting to open "http://localhost:8112." Below are the MultiOTP and nginx error logs.

*Note: I have started nginx-php from here: C:\MultiOTP\windows\webservice\start-nginx-php.cmd, and I am encountering a php-cgi.exe - System Error. It shows that VCRUNTIME140.dll was not found. I have manually downloaded and installed the mentioned DLL on my Windows Server, but the issue persists. Additionally, I have downloaded the Microsoft Visual C++ Redistributable package (VC_redist.x64.exe) from the Microsoft support page, but this also did not fix my issue. Please check and help me to fix this ASAP.


MultiOTP Log:

multiotp 5.9.7.0 Your script is running from C:\MultiOTP\windows.\ 2023-12-26 11:16:01 debug System Debug: ReadConfigData, stat value for create_host was OTPSRV 0 OTPSRV 2023-12-26 11:16:01 debug System Debug: ReadConfigData, stat value for create_time was 1703582368 0 OTPSRV 2023-12-26 11:16:01 debug System Debug: ReadConfigData, stat value for last_update was 1703582368 0 OTPSRV 2023-12-26 11:16:01 debug System Debug: ReadConfigData, stat value for last_update_host was OTPSRV 0 OTPSRV 2023-12-26 11:16:01 debug System Debug: *ReadConfigData, stat value for encryption_hash was 99CCFC0D033729754B6BB4832FE786A1 0 OTPSRV 2023-12-26 11:16:01 debug LDAP Debug: AD/LDAP synchronization started at 11:16:01 / Memory used: 14.5MB / Peak: 27.1MB 0 OTPSRV 2023-12-26 11:16:01 info LDAP Info: AD/LDAP synchronization started 0 OTPSRV 2023-12-26 11:16:01 debug System Debug: LDAP cache folder created (C:\Users\ADMINI~1\AppData\Local\Temp.ldap_cache/) 0 OTPSRV 2023-12-26 11:16:01 debug System Debug: LDAP cache folder value: C:\Users\ADMINI~1\AppData\Local\Temp.ldap_cache/ 0 OTPSRV 2023-12-26 11:16:02 debug System Info: File created: C:\MultiOTP\windows.\users\saugat.db 1 OTPSRV 2023-12-26 11:16:02 info System Info: User saugat automatically created 1 OTPSRV 2023-12-26 11:16:02 info LDAP Info: 1 user created, based on 1 LDAP entries (processed in 00:00:01) 0 OTPSRV 2023-12-26 11:16:02 debug Debug Debug: 19 INFO: Requested operation successfully done 0 OTPSRV


Nginx Error Log:

2023/12/26 16:01:49 [error] 5212#5136: 1 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:8112" 2023/12/26 16:01:54 [error] 5212#5136: 1 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:8112" 2023/12/26 16:02:17 [error] 5212#5136: 5 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8112" 2023/12/26 16:11:49 [error] 5212#5136: 8 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 192.168.12.117, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.48.30:8112" 2023/12/26 16:11:51 [error] 5212#5136: *8 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 192.168.12.117, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.48.30:8112", referrer: "http://192.168.48.30:8112/"

prosaugat commented 10 months ago

Someone, Please help me with this. It's urgent.

multiOTP commented 10 months ago

Hello, you need to run the webservice_install.cmd as administrator in order to setup correctly the webservice and the Windows firewall.

Best regards

prosaugat commented 10 months ago

Hello, you need to run the webservice_install.cmd as administrator in order to setup correctly the webservice and the Windows firewall.

Best regards

Each time I am running as 'run as administrator' and firewall is already disabled. Now help me I am facing same issue on Windows server 2016 and 2019 as well.

ocsnetworks commented 10 months ago

Download and install the current version of Visual C++ Redistributable You must install both x86 and x64 versions.

Had this issue myself just today....

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022

https://aka.ms/vs/17/release/vc_redist.x86.exe

https://aka.ms/vs/17/release/vc_redist.x64.exe

prosaugat commented 10 months ago

Thank you! ocsnetworks. It worked