1. Introduction When a web project is published on our Linux server, sometimes we need to configure an SSL certificate, which means that your website is more official, hahahaha. Once I downloaded the certificate and configured nginx.conf, everything was ready except for restarting. As a result, when I restarted, duang~something went wrong. nginx: [emerg] unknown directive ssl, this is the error message Because we need to reference the SSL module in nginx when configuring this SSL certificate, but when we first compiled Nginx, we did not compile the SSL module together, which led to this error. 2. Error resolution steps Since SSL was not compiled during installation, should I uninstall nginx and reinstall it? No, no, no, we just need to add the ssl module on the original basis. Step 1: Let's go to the decompressed directory where we downloaded the nginx package. If you installed it according to the tutorial I wrote, the decompressed directory should be "/usr/loacl/src/". Most of them should be in this directory, which is already a standard. Step 2: After entering the decompressed directory, execute the following commands in order: Command 1, ./configure --with-http_ssl_module //Re-add the ssl module Note that if no error occurs, just look at command 2 This error occurs when executing the above command (./configure: error: SSL module requires OpenSSL library.) The reason is that OpenSSL is missing. Then we can install another one and execute: yum -y install openssl openssl-devel After OpenSSL is installed, execute ./configure and then execute "Command 1". Command 2: Execute the make command, but do not execute make install, because make is used for compilation, and make install is for installation, otherwise your entire nginx will be overwritten. Command 3. After we execute the command, we can see that there is an additional nginx file in the objs folder in the nginx decompression directory. This is the new version of the program. First, we back up the previous nginx, and then copy the new program to overwrite the previous one. cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak cp objs/nginx /usr/local/nginx/sbin/nginx Command 4. Finally, we go to the Nginx installation directory to check whether the SSL module has been installed successfully. Execute ./sbin/nginx -V to see the following figure: 3. Finally, if the above picture appears, the SSL module has been added to Nginx and compiled, and the restart is OK this time. If you restart nginx, the following error is reported: nginx error: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead Change ssl on to listen 443 ssl. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed explanation of how to query fields containing '%' in MySQL like (ESCAPE usage)
>>: HTML table tag tutorial (3): width and height attributes WIDTH, HEIGHT
"The great river flows eastward, the waves w...
1. Function Introduction sed (Stream EDitor) is a...
Code Explanation 1.1 http:www.baidu.test.com defa...
Table of contents 1. Drag effect example 2. CSS I...
I encountered a very strange problem today. Look a...
When learning mybatis, I encountered an error, th...
Table of contents Vue this.$store.state.xx.xx Get...
First, let me introduce how to install PHP on Cen...
This article example shares the specific code of ...
Table of contents Preface 1. Custom focus command...
1Several common character sets In MySQL, the most...
If I want to make the form non-input-capable, I se...
Let me summarize a problem that I have encountere...
Preface The master-slave replication relationship...
Implementation of regular backup of Mysql databas...