오픈레스트를 시작하는 방법

오픈레스트를 시작하는 방법

CentOS 7.9에서 openresty를 시작하려고 하면 nginx가 시작되지 않았다는 메시지가 나타납니다.

[root@k8sslave01 letsencrypt]# systemctl status openresty.service
● openresty.service - The OpenResty Application Platform
   Loaded: loaded (/usr/lib/systemd/system/openresty.service; disabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Thu 2023-11-30 18:28:25 CST; 2min 50s ago
  Process: 31432 ExecStart=/usr/local/openresty/nginx/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 31430 ExecStartPre=/usr/local/openresty/nginx/sbin/nginx -t (code=exited, status=0/SUCCESS)

Nov 30 18:26:55 k8sslave01 systemd[1]: Starting The OpenResty Application Platform...
Nov 30 18:26:55 k8sslave01 nginx[31430]: nginx: the configuration file /usr/local/openresty/nginx/conf/nginx.conf syntax is ok
Nov 30 18:26:55 k8sslave01 nginx[31430]: nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test is successful
Nov 30 18:26:55 k8sslave01 systemd[1]: Can't open PID file /usr/local/openresty/nginx/logs/nginx.pid (yet?) after start: No such file or directory
Nov 30 18:28:25 k8sslave01 systemd[1]: openresty.service start operation timed out. Terminating.
Nov 30 18:28:25 k8sslave01 systemd[1]: Failed to start The OpenResty Application Platform.
Nov 30 18:28:25 k8sslave01 systemd[1]: Unit openresty.service entered failed state.
Nov 30 18:28:25 k8sslave01 systemd[1]: openresty.service failed.

nignx를 시작하면 openresty 구성이 nginx와 호환되지 않습니다.

[root@k8sslave01 letsencrypt]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2023-11-30 18:29:10 CST; 2min 52s ago
  Process: 32613 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
  Process: 32611 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)

Nov 30 18:29:10 k8sslave01 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 30 18:29:10 k8sslave01 nginx[32613]: nginx: [emerg] unknown "allowed" variable
Nov 30 18:29:10 k8sslave01 nginx[32613]: nginx: configuration file /etc/nginx/nginx.conf test failed
Nov 30 18:29:10 k8sslave01 systemd[1]: nginx.service: control process exited, code=exited status=1
Nov 30 18:29:10 k8sslave01 systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Nov 30 18:29:10 k8sslave01 systemd[1]: Unit nginx.service entered failed state.
Nov 30 18:29:10 k8sslave01 systemd[1]: nginx.service failed.

구성 파일을 에 넣었습니다 /etc/nginx/conf.d. 이 문제를 해결하려면 어떻게 해야 합니까? 이것은 개방형 버전입니다:

[root@k8sslave01 letsencrypt]# openresty -V
nginx version: openresty/1.21.4.3
built by gcc 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)
built with OpenSSL 1.1.1s  1 Nov 2022
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' --add-module=../ngx_devel_kit-0.3.2 --add-module=../echo-nginx-module-0.63 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.33 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.09 --add-module=../srcache-nginx-module-0.33 --add-module=../ngx_lua-0.10.25 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.34 --add-module=../array-var-nginx-module-0.06 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.9 --add-module=../ngx_stream_lua-0.0.13 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl111/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib' --with-cc='ccache gcc -fdiagnostics-color=always' --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-compat --with-stream --with-http_ssl_module

답변1

스톡 nginx에서는 openresty 구성을 사용할 수 없습니다.

즉, 다른 데몬에 내용을 복사하려고 시도하는 대신 개방형 상태를 수정하세요.

관련 정보