In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to install Nginx in Linux centos7 environment". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install Nginx in Linux centos7 environment.
Detailed explanation of the steps of installing nginx in linux centos7 environment
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.
At this point, I believe you have a deeper understanding of "how to install Nginx in the Linux centos7 environment". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.