【紧急求助】CentOS 9 Stream 编译安装openresty版本 错误 | openresty-1.25.3.1

121 views
Skip to first unread message

ls too

unread,
Aug 8, 2024, 9:26:35 PM8/8/24
to openresty
问题环境:
系统是: CentOS 9 Stream
我编译的版本是
版本:
openresty-1.25.3.1/ openresty-1.25.3.2 都出现以下问题,执行 ./configure 都是正常的

"install_openresty_text"函数代码如下:

install_openresty_text() {
log "INFO" "开始编译安装 OpenResty Nginx"

local openresty_filename="${OPENRESTY_VERSION_NAME}"
local openresty_url="${OPENRESTY_URL}"

# 下载 OpenResty
execute_command "download_module \"${openresty_filename}\" \"${goog_584717884openresty_url}\" \"${DOWNLOAD_DIR}\" \"wget\" \"y\"" "下载 $openresty_filename 模块" "y"

local openresty_src_dir="$DOWNLOAD_DIR/openresty-${NGINX_VERSION}"
execute_command "cd $openresty_src_dir" "切换到 OpenResty 源码目录" "y"

log "INFO" "切换到 OpenResty 源码目录: $openresty_src_dir"

local openresty_pwd=$(pwd)

log "INFO" "切换到 OpenResty 源码目录: $openresty_src_dir, 验证当前路径:${openresty_pwd}"
sleep 8

# 设置相关软件安装路径/目录
perl_openresty_path="${libs["perl_install_path_dir"]}"
zlib_openresty_path="${libs["zlib_install_path_dir"]}"
pcre_openresty_path="${libs["perl_install_path_dir"]}"
libmaxminddb_openresty_path="${libs["libmaxminddb_install_dir"]}"
modsecurity_nginx_openresty_path="${libs["modsecurity_install_dir"]}"

# declare -A CONFIGURE_OPTIONS
# 配置 OpenResty 的编译选项
local CONFIGURE_OPTIONS=(
"--prefix=${NGINX_DIR}"
"--sbin-path=${NGINX_DIR}/sbin"
"--conf-path=${NGINX_DIR}/conf/nginx.conf"
"--error-log-path=${NGINX_LOG_DIR}/nginx_error.log"
"--http-log-path=${NGINX_LOG_DIR}/nginx_access.log"
"--pid-path=${NGINX_DIR}/run/nginx.pid"
"--lock-path=${NGINX_DIR}/run/nginx.lock"
"--user=${NGINX_USER}"
"--group=${NGINX_USER}"
"--build=CentOS"
"--with-select_module"
"--with-poll_module"
"--with-threads"
"--with-file-aio"
"--with-http_realip_module"
"--with-http_addition_module"
"--with-http_xslt_module=dynamic"
"--with-http_sub_module"
"--with-http_dav_module"
"--with-http_flv_module"
"--with-http_mp4_module"
"--with-http_gunzip_module"
"--with-http_auth_request_module"
"--with-http_random_index_module"
"--with-http_secure_link_module"
"--with-http_degradation_module"
"--with-http_slice_module"
"--with-http_gzip_static_module"
"--with-http_stub_status_module"
"--with-http_perl_module=dynamic"
"--http-client-body-temp-path=${openresty_dir}/cache/client_temp"
"--http-proxy-temp-path=${openresty_dir}/cache/proxy_temp"
"--http-fastcgi-temp-path=${openresty_dir}/cache/fastcgi_temp"
"--http-uwsgi-temp-path=${openresty_dir}/cache/uwsgi_temp"
"--http-scgi-temp-path=${openresty_dir}/cache/scgi_temp"
"--with-mail=dynamic"
"--with-mail_ssl_module"
"--with-stream=dynamic"
"--with-stream_ssl_module"
"--with-stream_realip_module"
"--with-stream_ssl_preread_module"
"--with-compat"
"--with-debug"
"--with-luajit"
"--with-http_v2_module"
"--with-http_v3_module"
"--with-http_ssl_module"
"--with-http_gzip_static_module"
"--with-http_stub_status_module"
"--with-http_image_filter_module=dynamic"
"--with-pcre-jit"
"--with-cc-opt=-D_POSIX_C_SOURCE=200112L -DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC -O2 -I${libmaxminddb_openresty_path}/include -I${modsecurity_nginx_openresty_path}/include -I/usr/local/include"
"--with-ld-opt=-Wl,-rpath,${NGINX_DIR}/luajit/lib -L/usr/local/lib -L${modsecurity_nginx_openresty_path}/lib -L${libmaxminddb_openresty_path}/lib"
"--add-module=/opt/ngx/modsecurity-nginx-v1.0.3"
"--add-module=/opt/ngx/ngx_cache_purge-2.3"
"--add-module=/opt/ngx/ngx_http_consistent_hash-master"
"--add-module=/opt/ngx/ngx_http_geoip2_module-3.4"
"--add-module=/opt/ngx/ngx_http_substitutions_filter_module-0.6.4"
"--add-module=/opt/ngx/ngx_brotli-1.0.0rc"
"--add-module=/opt/ngx/redis2-nginx-module-0.15"
"--add-module=/opt/ngx/encrypted-session-nginx-module-0.09"
"--add-module=/opt/ngx/ngx_waf-10.1.2"
)


log "INFO" "执行配置命令: ${CONFIGURE_OPTIONS[*]}"
local openresty_OPTIONS_pwd=$(pwd)

log "INFO" "切换到 OpenResty 源码目录: $openresty_src_dir, 执行 CONFIGURE 验证当前路径:${openresty_OPTIONS_pwd}"

log "INFO" "清除之前的构建缓存"
make clean

sleep 5

log "INFO" "打印所有 CONFIGURE_OPTIONS:"
for option in "${CONFIGURE_OPTIONS[@]}"; do
log "INFO" " $option"
done
sleep 5
# 执行 configure
# ./configure "${CONFIGURE_OPTIONS[@]}"
./configure "${CONFIGURE_OPTIONS[@]}"
# execute_command "./configure ${CONFIGURE_OPTIONS[*]}" "配置 OpenResty" "y"
exit 1
}

执行.confgure 命令结果如下:

checking for require defined symbols (--require-defined) ... found
+ ngx_stream_lua_module was configured
adding module in /opt/ngx/modsecurity-nginx-v1.0.3
checking for ModSecurity library ... found
+ ngx_http_modsecurity_module was configured
adding module in /opt/ngx/ngx_cache_purge-2.3
+ ngx_http_cache_purge_module was configured
adding module in /opt/ngx/ngx_http_consistent_hash-master
+ ngx_http_upstream_consistent_hash was configured
adding module in /opt/ngx/ngx_http_geoip2_module-3.4
checking for MaxmindDB library ... found
+ ngx_geoip2_module was configured
adding module in /opt/ngx/ngx_http_substitutions_filter_module-0.6.4
+ ngx_http_subs_filter_module was configured
adding module in /opt/ngx/ngx_brotli-1.0.0rc
+ ngx_brotli was configured
adding module in /opt/ngx/redis2-nginx-module-0.15
+ ngx_http_redis2_module was configured
adding module in /opt/ngx/encrypted-session-nginx-module-0.09
found ngx_devel_kit for ngx_encrypted_session; looks good.
+ ngx_http_encrypted_session_module was configured
adding module in /opt/ngx/ngx_waf-10.1.2
checking for modsecurity library ... found
checking for curl library ... found
checking for cJSON library ... found
checking for uthash library ... found
checking for C99 features ... found
checking for sodium library ... found
+ ngx_http_waf_module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for OpenSSL library ... found
checking for OpenSSL QUIC support ... not found
checking for OpenSSL QUIC compatibility ... found
checking for zlib library ... found
checking for libxslt ... found
checking for libexslt ... found
checking for GD library ... found
checking for GD WebP support ... found
checking for perl
+ perl version: This is perl 5, version 38, subversion 2 (v5.38.2) built for x86_64-linux-thread-multi
+ perl interpreter multiplicity found
creating objs/Makefile

Configuration summary
+ using threads
+ using system PCRE library
+ using system OpenSSL library
+ using system zlib library

nginx path prefix: "/www_v2/server/nginx/nginx"
nginx binary file: "/www_v2/server/nginx/sbin"
nginx modules path: "/www_v2/server/nginx/nginx/modules"
nginx configuration prefix: "/www_v2/server/nginx/conf"
nginx configuration file: "/www_v2/server/nginx/conf/nginx.conf"
nginx pid file: "/www_v2/server/nginx/run/nginx.pid"
nginx error log file: "/www_v2/wwwlogs/nginx_error.log"
nginx http access log file: "/www_v2/wwwlogs/nginx_access.log"
nginx http client request body temporary files: "/cache/client_temp"
nginx http proxy temporary files: "/cache/proxy_temp"
nginx http fastcgi temporary files: "/cache/fastcgi_temp"
nginx http uwsgi temporary files: "/cache/uwsgi_temp"
nginx http scgi temporary files: "/cache/scgi_temp"

cd ../..
Type the following commands to build and install:
gmake
gmake install



在执行gmake 结果后Log信息如下:

src/core/ngx_syslog.h:30:56: error: unknown type name ‘u_char’; did you mean char’?
30 | u_char *ngx_syslog_add_header(ngx_syslog_peer_t *peer, u_char *buf);
| ^~~~~~
| char
src/core/ngx_syslog.h:31:58: error: unknown type name ‘u_char’; did you mean char’?
31 | void ngx_syslog_writer(ngx_log_t *log, ngx_uint_t level, u_char *buf,
| ^~~~~~
| char
src/core/ngx_syslog.h:33:50: error: unknown type name ‘u_char’; did you mean char’?
33 | ssize_t ngx_syslog_send(ngx_syslog_peer_t *peer, u_char *buf, size_t len);
| ^~~~~~
| char
In file included from src/core/ngx_core.h:97,
from src/core/ngx_bpf.h:12,
from src/event/quic/ngx_event_quic_bpf_code.c:6:
src/core/ngx_proxy_protocol.h:29:1: error: unknown type name ‘u_char’; did you mean char’?
29 | u_char *ngx_proxy_protocol_read(ngx_connection_t *c, u_char *buf,
| ^~~~~~
| char
src/core/ngx_proxy_protocol.h:29:54: error: unknown type name ‘u_char’; did you mean char’?
29 | u_char *ngx_proxy_protocol_read(ngx_connection_t *c, u_char *buf,
| ^~~~~~
| char
src/core/ngx_proxy_protocol.h:30:5: error: unknown type name ‘u_char’; did you mean char’?
30 | u_char *last);
| ^~~~~~
| char
src/core/ngx_proxy_protocol.h:31:1: error: unknown type name ‘u_char’; did you mean char’?
31 | u_char *ngx_proxy_protocol_write(ngx_connection_t *c, u_char *buf,
| ^~~~~~
| char
src/core/ngx_proxy_protocol.h:31:55: error: unknown type name ‘u_char’; did you mean char’?
31 | u_char *ngx_proxy_protocol_write(ngx_connection_t *c, u_char *buf,
| ^~~~~~
| char
src/core/ngx_proxy_protocol.h:32:5: error: unknown type name ‘u_char’; did you mean char’?
32 | u_char *last);
| ^~~~~~
| char
gmake[2]: *** [objs/Makefile:1688: objs/src/event/quic/ngx_event_quic_bpf_code.o] Error 1
gmake[2]: Leaving directory '/opt/text/openresty-1.25.3.1/build/nginx-1.25.3'
gmake[1]: *** [Makefile:10: build] Error 2
gmake[1]: Leaving directory '/opt/text/openresty-1.25.3.1/build/nginx-1.25.3'
gmake: *** [Makefile:9: all] Error 2



我需要你们的帮助
请问目前出问题时在哪里?怎么修复该错误,如果需要更多信息请告诉我,直到问题解决   

ls too

unread,
Aug 8, 2024, 9:33:41 PM8/8/24
to open...@googlegroups.com
image.png
image.png

ls too <huishou...@gmail.com> 于2024年8月9日周五 09:32写道:
Dear all


问题环境:
系统是: CentOS 9 Stream
内核:5.14.0-480.el9.x86_64

我编译的版本是
版本:
openresty-1.25.3.1/ openresty-1.25.3.2 都出现以下问题,执行 ./configure 都是正常的

但正常后我们执行 gmake / 或者make 都出现以下错误,我实在找不到问题,因此向官方社区求助

ls too

unread,
Aug 9, 2024, 1:49:07 AM8/9/24
to open...@googlegroups.com
image.png

image.png

ls too <huishou...@gmail.com> 于2024年8月9日周五 09:26写道:
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
---
您收到此邮件是因为您订阅了Google群组上的“openresty”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+...@googlegroups.com
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/596d8ad3-04ca-40b8-b61f-8a8849b303b4n%40googlegroups.com
Reply all
Reply to author
Forward
0 new messages