Error issues that may occur when nginx is installed with make compilation
First, report an error
src/core/ngx_murmurhash.c: In function ‘ngx_murmur_hash2’:
src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[2] << 16;
^~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: note: here
case 2:
^~~~
src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[1] << 8;
^~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: note: here
case 1:
^~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:473: objs/src/core/ngx_murmurhash.o] Error 1
make[1]: Leaving directory ‘/root/nginx-1.10.1‘
make: *** [Makefile:8: build] Error 2
Analyze the reasons:
Open the nginx installation directory /objs/Makefile, remove -Werror from CFLAGS, and make again
- -Wall Enables all warnings of gcc
- -Werror, which requires gcc to treat all warnings as errors
Second, make errors
src/os/unix/ngx_user.c: In function ‘ngx_libc_crypt’:
src/os/unix/ngx_user.c:36:7: error: ‘struct crypt_data’ has no member named ‘current_salt’
cd.current_salt[0] = ~salt[0];
^
make[1]: *** [objs/Makefile:774: objs/src/os/unix/ngx_user.o] Error 1
make[1]: Leaving directory ‘/root/nginx-1.10.1‘
make: *** [Makefile:8: build] Error 2
struct crypt_data 'does not have a member named' current_salt ': cd.current_salt[0] = ~salt[0];
The best way is to change the version, because of the condition, we will go into the source code and comment out this line.
# vim src/os/unix/ngx_user.c Go inside and comment out 36 lines
The third error is the openssl version error
src/event/ngx_event_openssl.c: In function ‘ngx_ssl_dhparam’:
src/event/ngx_event_openssl.c:954:11: error: dereferencing pointer to incomplete type ‘DH’ {aka ‘struct dh_st’}
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
^~
src/event/ngx_event_openssl.c: In function ‘ngx_ssl_connection_error’:
src/event/ngx_event_openssl.c:1941:21: error: ‘SSL_R_NO_CIPHERS_PASSED’ undeclared (first use in this function); did you mean ‘SSL_R_NO_CIPHERS_SPECIFIED’?
|| n == SSL_R_NO_CIPHERS_PASSED /* 182 */
^~~~~~~~~~~~~~~~~~~~~~~
SSL_R_NO_CIPHERS_SPECIFIED
src/event/ngx_event_openssl.c:1941:21: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [objs/Makefile:816: objs/src/event/ngx_event_openssl.o] Error 1
make[1]: Leaving directory ‘/root/nginx-1.10.1‘
make: *** [Makefile:8: build] Error 2
The reason:
The default openssl 1.1.x version is used, resulting in inconsistent apis
Resolved:
Install openssl1.0 directly
Wget HTTP: / / http://www.openssl.org/source/openssl-1.1.0e.tar.gz / / download openssl/root @ iZgt88z6l1kvd7Z ~ # tar ZXVF. - Openssl-1.0e.tar. gz // Decompress [root@iZgt88z6l1kvd7Z ~]# cd openssl-1.0e / &&./config shared zlib --prefix=/usr/local/openssl &&make && make install Go to the directory to compile and install openssl in /usr/local/openssl [root@iZgt88z6l1kvd7Z openssl-1.1.0e]#./config -t [root@iZgt88z6l1kvd7Z openssl-1.1.0e]# make depend // A rule for a makefile, by scanning all C\C++ code in a directory, Thus judge the dependency between files, such as the a.c file called b.h(such as the situation include
), if the a.c file is changed later, it only needs to be re-translated a.c file, do not need to compile the b.h file. Otherwise all files need to be recompiled. [root@localhost openssl-1.0e]# cd /usr/local [root@iZgt88z6l1kvd7Z local]# ln -s openssl ssl [root@iZgt88z6l1kvd7Z local]# echo "/usr/local/openssl/lib" >>/etc/ld.so.conf [root@iZgt88z6l1kvd7Z local]# cd /root/openssl-1.1.0e Note that everyone's directory is different, I am here under the root openssl, as for others to see their own situation, Switch directory [root@iZgt88z6l1kvd7Z openssl-1.0e]# ldconfig [root@iZgt88z6l1kvd7Z openSSL-1.0e]# echo $? 0 [root @ iZgt88z6l1kvd7Z openssl - 1.1.0 e] # echo "PATH = $PATH: / usr/local/openssl/bin" > > / etc/profile && source/etc/profile Then re-enter nginx-1.9.9 and run [root@iZwz967a5gqt3aqi2g3pbkZ nginx-1.9.9]#./configure --prefix=/usr/local/nginx --add-module=/root/nginx-1.9.9/headers-more-nginx-module-0.33 --with-http_stub_status_module --with-http_ssl_module I have this command here, and yours./configure... It depends on you
make a new one
Sum up
The above is personal experience, I hope to give you a reference, but also hope that you support the script home.
- Nginx manual compilation, installation of super detailed tutorial
- nginx compilation and installation of common errors and solutions
- nginx enables examples of compilation parameters for ws access and Layer 4 loads
- nginx compilation and installation and common parameters detailed
- nginx rtmp module compilation arm version issues
Related article
-
Nginx allows users to access web sites through username and password authentication
This article mainly introduces a detailed understanding of Nginx practice to allow users to access the web site through user name password authentication, interested can understand.2016-11-11 -
nginx common commands into the shell script details
This article mainly introduces nginx common commands into the shell script detailed explanation, the article explains very clearly, interested students can study under2021-02-02 -
Windows Server 2016 MySQL database installation configuration detailed installation tutorial
This article mainly introduces the Windows Server 2016 MySQL database installation configuration detailed installation tutorial, need friends can refer to the next2017-08-08 -
Nginx 403 forbidden Causes and solutions for errors
yum installed nginx, everything is normal, but visit The Times 403 forbidden, the following article mainly introduces the causes of Nginx 403 forbidden error and solutions, need friends can refer to2022-08-08 -
Examples of ways to upgrade nginx to support HTTP2.0
This article mainly introduces the nginx upgrade to support HTTP2.0 method examples, the article through the example code introduction is very detailed, for everyone's study or work has a certain reference learning value, the need of friends below with the small series to learn it2019-07-07 -
nginx reverse proxy after infinite redirection problem workaround
This article mainly introduces the detailed solution to the problem of unlimited redirection after nginx reverse proxy. Friends in need can use it for reference. I hope it can be helpful2023-08-08 -
How Nginx deploys projects in specified folders (local testing)
This article mainly introduces Nginx how to deploy the project under the specified folder (local test), divided into configuration vue.config.js, specify the package of the generation environment, configure the routing mode for hash (history mode refresh, can not find the page), this article explains very detailed, need friends can refer to the next2024-01-01 -
Nginx upstream's 5 weight allocation methods share
Nginx upstream's 5 weight distribution methods to share, need friends can refer to2012-09-09 -
How to quickly install Nginx in CentOS7
Today, we will only explain how to quickly install Nginx under the CentOS7 system, this article shows you through the form of illustrations, interested friends together to see it2021-09-09 -
How do I deploy a python flask project on my own server using Nginx and uwsgi
Nginx is a high-performance HTTP And reverse proxy service, which is characterized by less memory, concurrency ability, in fact, nginx concurrency ability in the same type of web server performance is better, this article mainly introduces how to use Nginx and uwsgi in their own server to deploy python flask project, need friends can refer to2023-11-11
Latest comments