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

The method of installing nginx1.12.1 under centos6.4

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "the method of installing nginx1.12.1 under centos6.4". In the daily operation, I believe that many people have doubts about the method of installing nginx1.12.1 under centos6.4. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the method of installing nginx1.12.1 under centos6.4". Next, please follow the editor to study!

Environment required for installation

1. Gcc installation

To install nginx, you need to compile the source code downloaded from the official website. The compilation depends on the gcc environment. If there is no gcc environment, you need to install:

Yum install gcc-c++

2. Pcre pcre-devel installation

Pcre (perl compatible regular expressions) is a perl library, including a perl-compatible library of regular expressions. Nginx's http module uses pcre to parse regular expressions, so you need to install the pcre library on linux. Pcre-devel is a secondary development library developed using pcre. This library is also required for nginx. Command:

Yum install-y pcre pcre-devel

3. Zlib installation

The zlib library provides many ways to compress and decompress. Nginx uses zlib to gzip the contents of the http package, so you need to install the zlib library on centos.

Yum install-y zlib zlib-devel

4. Openssl installation

Openssl is a powerful secure socket layer cipher library that includes major cryptographic algorithms, commonly used key and certificate encapsulation management functions, and ssl protocols, and provides rich applications for testing or other purposes.

Nginx supports not only the http protocol, but also https (that is, http over the ssl protocol), so you need to install the openssl library on centos.

Yum install-y openssl openssl-devel

Installation

1.nginx URL

two。 Download using the wget command

# wget-c https://nginx.org/download/nginx-1.12.1.tar.gz

3. Decompression

# tar-zxvf nginx-1.12.1.tar.gz#cd nginx-1.12.1

4. Configuration

#. / configure

5. Installation

# make

# make install

Find the installation path:

# whereis nginx

Start and stop nginx

# cd / usr/local/nginx/sbin/./nginx. / nginx-s stop./nginx-s quit./nginx-s reload

. / nginx-s quit: in this way, the stop step is to stop after the nginx process has finished processing the task.

. / nginx-s stop: this method is equivalent to finding out the nginx process id and then using the kill command to force the killing of the process.

Query the nginx process:

# ps aux | grep nginx

Start nginx and enter localhost in the browser

At this point, the study of "the method of installing nginx1.12.1 under centos6.4" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Internet Technology

Wechat

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

12
Report