Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Uninstall and install tutorials for linux server nginx

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Preface

When I first came into contact with the linux server, the nginx configuration was a bit hideously messy, so I uninstalled the old one and reinstalled it. I won't say much. Let's take a look at the detailed introduction.

Unloading

Linux has a series of software managers, such as yum under linux, apt-get under Ubuntu, and so on. Through these software managers, you can quickly uninstall the software, and there will be no files and configuration residue. I am using yum here, and the command is as follows

Yum remove nginx

Installation

Compared to uninstalling, installation is relatively troublesome, but it's okay. One step at a time.

1. Download and extract the installation package

Wget http://nginx.org/download/nginx-1.13.7.tar.gztar-xvf nginx-1.13.7.tar.gzmv nginx-1.13.7.tar.gz nginx / / renamed to short name

Many people say that it is right to pretend to be dependent first, but you can also put it in the back, read the newspaper wrong, and need that one to install that, so that you can be impressed.

If you want to install dependencies first, there are mainly four

Gcc and gcc-c++: are mainly used for compilation and related use.

Openssl, openssl-devel: this is generally required when configuring https services

Zlib, zlib-devel: mainly used for decompressing files

Pcre, pcre-devel: Nginx's rewrite module and HTTP core module will use PCRE regular expression syntax

For the rest, you can install it without reporting a mistake.

2. Configuration, compilation and installation

. / configuremakemake install

3. Nginx starts the test

. / nginx-t

The following indicates that the configuration is normal

Nginx: the configuration file / usr/local/nginx/conf/nginx.conf syntax is ok

Nginx: configuration file / usr/local/nginx/conf/nginx.conf test is successful

In the process, you may encounter the problem of lack of dependence, yum install XXX as soon as you lose it. This is the end of the configuration.

Naive!!!

The above is the "Bon voyage" process.

If you want to configure a server for https, you may encounter the following error

Nginx: [emerg] unknown directive "ssl"

The ssl command is not recognized?! This is because the relevant modules of OpenSSL are not loaded by default. The solution is as follows:

. / configure-- with-http_ssl_module / / re-config and specify other modules http_ssl_module make / / Don't make install, don't make install, don't make install, then overwrite cp / usr/local/nginx/sbin/nginx / usr/local/nginx/sbin/nginx.bak / / if you want to delete the original nginx backup, you can cp objs/nginx / usr/local/nginx/sbin/nginx / / objs directory is the compiled file. / usr/local/nginx/sbin/nginx-t / / try again

Wait, wait, wait.

Summary

The above is the whole content of this article. I hope the content of this article has a certain reference and learning value for everyone's study or work. Thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report