首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >nginx和nginx-auth-ldap不会

nginx和nginx-auth-ldap不会
EN

Server Fault用户
提问于 2018-11-19 17:14:20
回答 1查看 940关注 0票数 0

我以前也这样做过,并使用了以下指南:https://calvin.me/nginx-ldap-http-authentication/

不幸的是,最近该服务器出现了一些与nginx崩溃有关的重大问题(最近配置没有任何变化);

代码语言:javascript
运行
复制
    configuration file /etc/nginx/nginx.conf test failed\n',). Skipping.
/var/log/syslog.1:Nov 19 02:55:55 UB01 certbot[26093]: Error while running nginx -c /etc/nginx/nginx.conf -t.
/var/log/syslog.1:Nov 19 02:55:55 UB01 certbot[26093]: nginx: [emerg] unknown directive "ldap_server" in /etc/nginx/nginx.conf:35
/var/log/syslog.1:Nov 19 02:55:55 UB01 certbot[26093]: nginx: configuration file /etc/nginx/nginx.conf test failed
/var/log/syslog.1:Nov 19 02:55:57 UB01 certbot[26093]: Error while running nginx -c /etc/nginx/nginx.conf -t.
/var/log/syslog.1:Nov 19 02:55:57 UB01 certbot[26093]: nginx: [emerg] unknown directive "ldap_server" in /etc/nginx/nginx.conf:35
/var/log/syslog.1:Nov 19 02:55:57 UB01 certbot[26093]: nginx: configuration file /etc/nginx/nginx.conf test failed
/var/log/syslog.1:Nov 19 02:55:57 UB01 certbot[26093]: Attempting to renew cert (engtest.harrisisi.com) from /etc/letsencrypt/renewal/engtest.harrisisi.com.conf produced an unexpected error: The nginx plugin is not working; there may be problems with your existing configuration.
/var/log/syslog.1:Nov 19 02:55:57 UB01 certbot[26093]: The error was: MisconfigurationError('Error while running nginx -c /etc/nginx/nginx.conf -t.\n\nnginx: [emerg] unknown directive "ldap_server" in /etc/nginx/nginx.conf:35\nnginx: configuration file /etc/nginx/nginx.conf test failed\n',). Skipping.
grep: /var/log/unattended-upgrades: Is a directory
grep: /var/log/upstart: Is a directory
user@computer:~$ sudo nginx -t
nginx: [emerg] unknown directive "ldap_server" in /etc/nginx/nginx.conf:35
nginx: configuration file /etc/nginx/nginx.conf test failed

我去查看nginx,发现ngx_http_auth_ldap_module.c的大小与我以前构建的相比有了很大的变化,所以我决定删除最新的所有内容,并对nginx及其模块进行最新的安装。不幸的是,当它击中nginx时,它似乎出了很大问题。我不知道接下来该怎么做。

代码语言:javascript
运行
复制
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3103:9: error: stray ‘\’ in program
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3300:9: error: stray ‘\’ in program
                     ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "http_auth_ld
         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3300:9: error: stray ‘\’ in program
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3333:71: error: stray ‘#’ in program
         #if (NGX_OPENSSL)
                                                                       ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3373:71: error: stray ‘#’ in program
         #endif
                                                                       ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3381:9: error: stray ‘\’ in program
                 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "http_auth_ldap:
         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3397:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3627:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3727:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3823:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:3911:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4040:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4106:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4177:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4270:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4354:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4543:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4677:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4764:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4807:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4858:72: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:4934:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5010:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5082:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5154:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5195:74: error: expected identifier or ‘(’ before ‘<’ token
         };
                                                                          ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5243:9: error: stray ‘\’ in program
                 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, #if (NGX_OPENSSL)
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5309:72: error: stray ‘#’ in program
         #endif
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5396:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5417:9: error: stray ‘\’ in program
             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0}
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5501:9: error: stray ‘\’ in program
             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->r->connection->}
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5629:9: error: stray ‘\’ in program
             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5725:9: error: stray ‘\’ in program
             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5829:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5843:72: error: stray ‘#’ in program
         #if (NGX_OPENSSL)
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5947:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:5951:72: error: stray ‘#’ in program
         #endif
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6024:9: error: stray ‘\’ in program
             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6226:72: error: stray ‘#’ in program
         #if (NGX_OPENSSL)
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6259:80: error: stray ‘#’ in program
                 #if OPENSSL_VERSION_NUMBER >= 0x10002000
                                                                                ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6362:180: error: stray ‘#’ in program
                         "does not match address (neither server's domain nor IP in certificate's CN or SAN)                "does not match address (neither server's domain nor IP in certificate's CN or SAN)                fprintf(stderr, "DEBUG: SSL cert domain mismatch\n        #endif
                                                                                ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6455:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6472:180: error: expected identifier or ‘(’ before ‘<’ token
         { ngx_http_auth_ldap_ssl_handshake_handler(conn, 1); }
                                                                                                                                                                                    ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6489:180: error: expected identifier or ‘(’ before ‘<’ token
         { ngx_http_auth_ldap_ssl_handshake_handler(conn, 0); }
                                                                                                                                                                                    ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6498:225: error: expected identifier or ‘(’ before ‘<’ token
         typedef void (*ngx_http_auth_ldap_ssl_callback)(ngx_connection_t *conn);
                                                                                                                                                                                                                                 ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6590:72: error: stray ‘#’ in program
         #if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6602:72: error: stray ‘#’ in program
         #else
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6614:72: error: stray ‘#’ in program
         #endif
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6650:72: error: stray ‘#’ in program
         #if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6658:72: error: stray ‘#’ in program
         #else
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6666:72: error: stray ‘#’ in program
         #endif
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6765:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6769:72: error: stray ‘#’ in program
         #endif
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6875:72: error: stray ‘#’ in program
         #if (NGX_OPENSSL)
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6895:72: error: stray ‘#’ in program
         #endif
                                                                        ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:6908:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:7084:9: error: stray ‘\’ in program
                     if (rc == LDAP_SERVER_DOWN && \
         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:7406:9: error: stray ‘\’ in program
                                     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:7601:9: error: stray ‘\’ in program
             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,         ngx_log_error(NGX_LOG_ERR, c->log, 0, 
         ^

/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10029:9: error: stray ‘\’ in program
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10102:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10292:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10461:73: error: expected identifier or ‘(’ before ‘<’ token
         }
                                                                         ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10488:12: error: missing terminating ' character [-Werror]
       
            ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10488:7: error: missing terminating ' character
       
       ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10508:31: error: expected identifier or ‘(’ before numeric constant
       © 2018 GitHub, Inc.
                               ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10541:5: error: stray ‘\342’ in program
     You can’t perform that action at this time.
     ^
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10541:5: error: stray ‘\200’ in program
/home/user/nginx-auth-ldap//ngx_http_auth_ldap_module.c:10541:5: error: stray ‘\231’ in program
cc1: all warnings being treated as errors
objs/Makefile:1250: recipe for target 'objs/addon/nginx-auth-ldap/ngx_http_auth_ldap_module.o' failed
make[1]: *** [objs/addon/nginx-auth-ldap/ngx_http_auth_ldap_module.o] Error 1
make[1]: Leaving directory '/home/user/nginx-1.14.1'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2
user@computer:~/nginx-1.14.1$
EN

回答 1

Server Fault用户

发布于 2018-11-19 17:21:59

你在试图编译一个网页,而不是源代码。回到你拿到那个文件的地方,然后再试一次。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/940736

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档