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

Analysis of Nginx installation example under Linux centos7 Environment

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article introduces the relevant knowledge of "Nginx installation instance analysis under Linux centos7 environment". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. First go to the nginx official website to download the nginx installation package.

After downloading, you will see a file similar to the following

Create a nginx-src directory and go to the nginx-src directory and run the following command:

Mkdir nginx-src & & cd nginx-src

Of course, you can also download the nginx installation package by running the following command under linux

Wget http://nginx.org/download/nginx-1.5.9.tar.gz

2. Extract the nginx-1.5.9.tar.gz file

Tar-zxvf nginx-1.5.9.tar.gz

3. Delete installation package file command

Rm-f nginx-1.5.9.tar.gz

4. Configure, install and run commands

Cd nginx-1.5.9/./configure-prefix=/usr/local/nginx

Maybe it is a hint that the package is missing:

. / configure: error: the http rewrite module requires the pcre library.

You can either disable the module by using-without-http_rewrite_module

Option, or install the pcre library into the system, or build the pcre library

Statically from the source with nginx by using-- with-pcre= option.

Install pcre-devel to solve the problem (need to run under the network and be a super administrator)

Yum-y install pcre-develyum-y install openssl openssl-devel

To switch to root Super Admin status: su

Reconfigure now

. / configure-- prefix=/usr/local/nginx

If the reconfiguration is not successful, you need to install gcc

Yum-y install gcc

Configure again after installing gcc

5. Compile command

Make

6. Installation command

Make install

7. After installation, start nginx

Cd / usr/local/nginx/sbin

. / nginx

If the startup is not successful, it may be caused by a firewall problem.

At this point, you need to turn off the firewall.

Systemctl stop firewalld.service

8. Visit nginx

Http://ip address

9. If you want to simplify the configuration file

Reload the configuration file

Run the command: nginx-s reload

To the blogger, I successfully installed the nginx server under linux centos7.

And has successfully accessed nginx through the ip address on the browser.

This is the end of the content of "Nginx installation example Analysis in Linux centos7 Environment". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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