Невозможно скомпилировать NGINX с модулем SPNE GO - PullRequest
0 голосов
/ 10 апреля 2020

В настоящее время я работаю над новым Intr anet с Symfony Framework. Я бы хотел, чтобы пользователи автоматически входили в систему благодаря сеансу Windows. Поэтому я пытаюсь создать своего рода SSO с Kerberos.

Из того, что я узнал, мой текущий HTTP-сервер NGINX (на Windows сервере) должен быть построен из источников, с этим модуль: https://github.com/stnoonan/spnego-http-auth-nginx-module

Я впервые строю такое приложение на Windows, я пробовал следующие уроки:

http://nginx.org/en/docs/howto_build_on_win32.html

https://geekeries.org/2019/09/nginx-avec-une-authentification-kerberos (по-французски, извините -)

Компиляция NGINX с Visual Studio (Очень полезный принятый ответ на этот вопрос вопрос)

и некоторые другие вещи .. Неудачно

Так что я использую MINGW с MSYS. Я добавил заголовочные файлы, необходимые для этого модуля (MIT Kerberos, по этой ссылке: http://web.mit.edu/kerberos/dist/kfw/3.2/kfw-3.2.2/kfw-3-2-2-sdk.zip)

Используемая команда конфигурирования следующая:

auto/configure \
--with-cc=cl \
--builddir=objs \
--with-debug \
--prefix= \
--conf-path=conf/nginx.conf \
--pid-path=logs/nginx.pid \
--http-log-path=logs/access.log \
--error-log-path=logs/error.log \
--sbin-path=nginx.exe \
--http-client-body-temp-path=temp/client_body_temp \
--http-proxy-temp-path=temp/proxy_temp \
--http-fastcgi-temp-path=temp/fastcgi_temp \
--http-scgi-temp-path=temp/scgi_temp \
--http-uwsgi-temp-path=temp/uwsgi_temp \
--with-cc-opt=-DFD_SETSIZE=1024 \
--with-pcre=objs/lib/pcre-8.44 \
--with-zlib=objs/lib/zlib-1.2.11 \
--with-select_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_stub_status_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_auth_request_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-mail \
--with-stream \
--with-openssl=objs/lib/openssl-1.1.1f \
--with-http_ssl_module \
--with-mail_ssl_module \
--with-stream_ssl_module \
--with-openssl-opt=no-asm \
--add-module=objs/lib/spnego-http-auth-nginx-module

И затем эту команду для сборки:

nmake -f objs/Makefile

Хотя после нескольких минут компиляции я получаю эти странные ошибки, поступающие из Windows sys \ stat.h:

cl -c -O2  -W3 -WX -nologo -MT -Zi -Fdobjs/nginx.pdb -DFD_SETSIZE=1024 -DNO_SYS_TYPES_H -Yungx_config.h -Fpobjs/ngx_config.pch -I src/core  -I src/event  -I src/event/modules  -I src/os/win32  -I objs/lib/pcre-8.44  -I objs/lib/openssl-1.1.1f/openssl/include  -I objs/lib/zlib-1.2.11  -I objs  -I src/http  -I src/http/modules  -I src/http/v2  -I src/mail  -I src/stream  -I objs/lib/spnego-http-auth-nginx-module/include  -Foobjs/addon/spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.obj  objs/lib/spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.c
ngx_http_auth_spnego_module.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(34): error C2061: erreur de syntaxe : identificateur '_off_t'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(38): error C2059: erreur de syntaxe : '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(64): error C2061: erreur de syntaxe : identificateur '_off_t'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(65): error C2371: 'st_atime' : redéfinition ; types de base différents
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(35): note: voir la déclaration de 'st_atime'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(66): error C2371: 'st_mtime' : redéfinition ; types de base différents
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(36): note: voir la déclaration de 'st_mtime'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(67): error C2371: 'st_ctime' : redéfinition ; types de base différents
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(37): note: voir la déclaration de 'st_ctime'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(68): error C2059: erreur de syntaxe : '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(97): error C2061: erreur de syntaxe : identificateur '_off_t'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(98): error C2371: 'st_atime' : redéfinition ; types de base différents
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(35): note: voir la déclaration de 'st_atime'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(99): error C2371: 'st_mtime' : redéfinition ; types de base différents
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(36): note: voir la déclaration de 'st_mtime'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(100): error C2371: 'st_ctime' : redéfinition ; types de base différents
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(37): note: voir la déclaration de 'st_ctime'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(101): error C2059: erreur de syntaxe : '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(236): error C2027: utilisation du type non défini 'stat'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(88): note: voir la déclaration de 'stat'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(236): error C2027: utilisation du type non défini '_stat64i32'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(55): note: voir la déclaration de '_stat64i32'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(241): error C2027: utilisation du type non défini 'stat'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(88): note: voir la déclaration de 'stat'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(241): error C2027: utilisation du type non défini '_stat64i32'
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\sys\stat.h(55): note: voir la déclaration de '_stat64i32'
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\cl.EXE"' : code retour '0x2'
Stop.

Снова извините за то, что это по-французски ..

Есть идеи, что может решить эту проблему? Я так потерян LOL

...