安装nginx报错:make: *** [build] Error 2

执行命令后:
sudo ./configure --prefix=/etc/nginx --with-http_ssl_module --with-openssl=/usr/bin/openssl --with-openssl=/usr/local/openssl-1.0.1t/

执行make

root@ubuntuserver4:/usr/local/nginx-1.11.3# sudo make
make -f objs/Makefile
make[1]: Entering directory `/usr/local/nginx-1.11.3'
cd /usr/local/openssl-1.0.1t/ \
        && if [ -f Makefile ]; then make clean; fi \
        && ./config --prefix=/usr/local/openssl-1.0.1t//.openssl no-shared  \
        && make \
        && make install_sw LIBDIR=lib
/bin/sh: 1: cd: can't cd to /usr/local/openssl-1.0.1t/
make[1]: *** [/usr/local/openssl-1.0.1t//.openssl/include/openssl/ssl.h] Error 2
make[1]: Leaving directory `/usr/local/nginx-1.11.3'
make: *** [build] Error 2

发现少了一个openssl-1.0.1t

弄过来重新执行 sudo ./configure --prefix=/etc/nginx --with-http_ssl_module --with-openssl=/usr/bin/openssl --with-openssl=/usr/local/openssl-1.0.1t/ 后就可以了
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
# 安装PCRE库 cd /usr/local/src sudo wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz sudo tar -zxvf pcre-8.41.tar.gz cd pcre-8.41 sudo ./configure sudo make sudo make install # 安装zlib库 cd /usr/local/src sudo wget http://zlib.net/zlib-1.2.11.tar.gz sudo tar -zxvf zlib-1.2.11.tar.gz cd zlib-1.2.11 sudo ./configure sudo make sudo make install # 安装ssl(某些vps默认没装ssl) cd /usr/local/src sudo wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz sudo tar -zxvf openssl-1.0.1t.tar.gz # 安装nginx # Nginx 一般有两个版本,分别是稳定版和开发版,您可以根据您的目的来选择这两个版本的其中一个,下面是把 Nginx 安装到 /usr/local/nginx 目录下的详细步骤: cd /usr/local/src sudo wget http://nginx.org/download/nginx-1.4.2.tar.gz sudo tar -zxvf nginx-1.4.2.tar.gz cd nginx-1.4.2 cd /usr/local/src sudo wget http://nginx.org/download/nginx-1.13.5.tar.gz sudo tar -zxvf nginx-1.13.5.tar.gz cd nginx-1.13.5 sudo ./configure --sbin-path=/usr/local/nginx/nginx \ --conf-path=/usr/local/nginx/nginx.conf \ --pid-path=/usr/local/nginx/nginx.pid \ --with-http_ssl_module \ --with-pcre=/usr/local/src/pcre-8.41 \ --with-zlib=/usr/local/src/zlib-1.2.11 \ --with-openssl=/usr/local/src/openssl-1.0.1t sudo make sudo make install #运行 sudo vim /usr/local/nginx/nginx.conf sudo ./nginx sudo ./nginx -s reload root实例: location ^~ /t/ { root /www/root/html/; } 如果一个请求的URI是/t/a.html时,web服务器将会返回服务器上的/www/root/html/t/a.html的文件。 alias实例: location ^~ /t/ { alias /www/root/html/new_t/; } location /data/ { proxy_pass http://localhost:9003/; } 如果一个请求的URI是/t/a.html时,web服务器将会返回服务器上的/www/root/html/new_t/a.html的文件。注意这里是new_t,因为alias会把location后面配置的路径丢弃掉,把当前匹配到的目录指向到指定的目录。
这个错误提示是在进行编译过程中出现的。具体的错误信息如下: - 在文件 `src/os/unix/ngx_user.c` 的第36行,出现了一个错误,即结构体 `crypt_data` 没有名为 `current_salt` 的成员。 - 在进行 `make` 编译时,出现了 `Error 1` 和 `Error 2` 的错误。 - 还有一个错误是在文件 `src/core/ngx_murmurhash.c` 的第37行和第39行,以及第38行和第40行,出现了 `fall through` 的警告。 根据这些错误信息,可以推断出一些可能的问题。首先,在 `ngx_user.c` 文件中,`current_salt` 这个成员可能是新版本的 `crypt_data` 结构体中新增的,而编译的版本是旧的,所以找不到这个成员引起了错误。其次,在编译过程中出现的 `Error 1` 和 `Error 2` 可能是由于前面的错误导致的。最后,在 `ngx_murmurhash.c` 文件中的 `fall through` 警告可能是由于编译器的警告级别设置导致的。 为了解决这些问题,可以尝试以下几个解决方案: 1. 检查你的编译环境是否正确配置,并确保使用的是最新版本的编译器。 2. 在编译之前,先更新你的源代码,确保使用的是最新版本。 3. 检查 `ngx_user.c` 文件中的代码,查看是否有与 `crypt_data` 结构体相关的更新。 4. 尝试降低编译器警告级别,或手动修复 `ngx_murmurhash.c` 文件中的 `fall through` 警告。 希望以上解决方案能够帮助你解决问题。如果还有其他疑问,请随时提问。123 #### 引用[.reference_title] - *1* *3* [nginx安装时,make 编译可能会出现的错误](https://blog.csdn.net/gcyaozuodashen/article/details/126656968)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] - *2* [安装nginx 执行make install 报错问题解决make[1]: *** [install] Error 1 make: *** [install] Error 2](https://blog.csdn.net/weixin_41400411/article/details/116059479)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值