ls too
unread,Aug 8, 2024, 9:26:35 PM8/8/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
我需要你们的帮助
请问目前出问题时在哪里?怎么修复该错误,如果需要更多信息请告诉我,直到问题解决