In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to install Nginx in Linux" related knowledge, editor through the actual case to show you the operation process, the method of operation is simple and fast, practical, I hope that this "how to install Nginx in Linux" article can help you solve the problem.
Prepare to install tools
\ 1. Download Nginx from the Nginx website. The version used here is 1.13.6.
\ 2. Upload the downloaded Nginx to Linux, using the / opt/nginx directory as an example. Run "tar-zxvf nginx-1.13.6.tar.gz" to extract.
\ 3. Change to the / opt/nginx/nginx-1.13.6 directory and run. / configure to initialize the configuration. If the following prompt appears, it means that the machine does not have PCRE installed, but Nginx depends on PCRE, and you need to install PCRE manually, which can be searched in the forum.
Install pcre hands-on
PCRE (Perl Compatible Regular Expressions) is a lightweight library of Perl functions, including a library of perl-compatible regular expressions. It is much smaller than regular expression libraries such as Boost. PCRE is easy to use and powerful, outperforming the POSIX regular expression library and some classic regular expression libraries.
\ 1. First go to this https://sourceforge.net/projects/pcre/files/pcre/ to download pcre, and the download version here is 8.40.
\ 2. Upload pcre-8.40.tar.gz to the / opt/pcre directory, run "tar-zxvf pcre-8.40.tar.gz", extract the pcre-8.40 directory, and then run chmod-R 777 pcre-8.40 to grant full read and write access to the current folder.
\ 3. Go to the / pcre-8.40 directory and run. / configure to initialize the configuration and print a pile of information, if prompted below, because of the lack of a C++ compiler.
Workaround: install the C++ compiler using the yum-y install gcc-c++ command.
Run. / configure after the C++ compiler is successfully installed.
\ 4. Perform the make operation to compile.
\ 5. Finally, execute the make install command, and the pcre installation is complete.
Continue to go back to the / opt/nginx/nginx-1.13.6 directory, run. / configure to initialize the configuration of nginx, and finally print the following message to prove the success. The address pointed to by the red arrow is the path where nginx was started.
(note: when running. / configure for nginx initialization configuration, if you want to add a ssl module, you can use the following command:
. / configure-prefix=/usr/local/nginx-with-http_ssl_module
If you have not installed openssl when you execute the above command, you will be prompted:
. / configure: error: SSL modules require the OpenSSL library.
Execute yum-y install openssl openssl-devel at this time, and after installing openssl, you can do the above operation smoothly.)
\ 4. Run make install to install
\ 5. Go to / usr/local/nginx/sbin directory, run. / nginx, and start nginx.
\ 6. To test whether the installation and startup is successful, enter the server IP: port (default 80) in the browser, and if the following figure appears, the installation has started successfully.
Run the test nginx
Common nginx commands:
View nginx process: ps-ef | grep nginx
Start nginx and execute:. / nginx under the / usr/local/nginx/sbin directory
Close nginx: under the / usr/local/nginx/sbin directory, execute:. / nginx-s quit
The nginx configuration file is in / usr/local/nginx/conf/nginx.conf. When the configuration file nginx.conf is modified, you need to restart nginx if you want the configuration to take effect. You can use. / nginx-s reload to make the modified configuration take effect. There is no need to stop and start again.
This is the end of the introduction on "how to install Nginx in Linux". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.