How to install Nginx in a specified location in Centos system? PrefaceRequirements analysisInstallation processEnvironment preparationInstall NginxRequired compilation and dependent librariesInstall OpenSSL libraryInstall PCRE libraryInstall Zlib libraryInstall NginxStart Nginx for verificationSprinkle flowers! Nginx installed successfully! Preface Because I didn’t have the habit of blogging before, many things were easily forgotten over time. Starting today, I will share the problems encountered at work and the solutions on Ctrip Blog. I hope to make progress together with all the programmers. Demand Analysis It is convenient for operation and maintenance personnel to install and deploy it during work. The project manager requires that the front-end package and the web server be packaged and stored uniformly. Installation Process Environment Preparation Operating system Centos7.X Install the compilation and dependent libraries required by Nginx Install the OpenSSL library # yum install openssl-devel when Centos connects to the network # When Centos has no network connection# Go to https://www.openssl.org/source/ to download the tar package and upload it to Centos /app/Nginx# Decompress it tar -zxvf openssl-1.0.1t.tar.gz # /app/Nginx/openssl-1.0.1t.tar.gz Remember this installation directory as it will be used later Install PCRE Library # yum install pcre-devel when Centos connects to the network # When Centos has no network connection # Go to https://ftp.pcre.org/pub/pcre/ and download the tar package and upload it to Centos /app/Nginx # Decompress it tar -zxvf pcre-8.40.tar.gz cd pcre-8.40 # Enter the folder # Compile command line ./configure make && make install # /app/Nginx/pcre-8.40 Remember this installation directory as it will be used later Install Zlib Library # yum install zlib-devel when Centos connects to the network # When Centos has no network connection# Go to https://www.zlib.net/ to download the tar package and upload it to Centos /app/Nginx# Decompress it tar -zxvf zlib-1.2.11.tar.gz cd zlib-1.2.11 # Enter the folder # Compile command line ./configure make && make install # /app/Nginx/zlib-1.2.11.tar.gz Remember this installation directory as it will be used later Install Nginx # Download the source package when Centos connects to the network wget http://nginx.org/download/nginx-1.16.1.tar.gz # When Centos has no network connection# Go to https://nginx.org/en/download.html to download the tar package and upload it to Centos /app/Nginx# Decompress it tar -zxvf nginx-1.16.1.tar.gz cd nginx-1.16.1 # Enter the folder # Set constants: ./configure \ --prefix=/app/Nginx/ \ --sbin-path=/app/Nginx/nginx \ --conf-path=/app/Nginx/nginx.conf \ --pid-path=/app/Nginx/nginx.pid \ --with-http_ssl_module \ --with-pcre=/app/Nginx/pcre-8.40 \ # The location of the pcre just installed --with-zlib=/app/Nginx/zlib-1.2.11 \ # The location of the zlib just installed --with-openssl=/app/Nginx/openssl-1.0.1t \ # The location of the openssl just installed# Compile command line make && make install test -d # Important!!! If not executed, the real nginx file will not be created Start Nginx for verification # Start Nginx cd /app/Nginx ./nginx Use a browser to access the server's IP address if the port number has been reconfigured. Then visit the IP address: port number. If this interface appears, it means that Nginx is installed successfully. Sprinkle flowers! Nginx installed successfully! This is the end of this article about how to install Nginx in a specified location on Centos. For more information about how to install Nginx in a specified location on Centos, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL database backup and recovery implementation code
1. Qualitative changes brought by CSS variables T...
The detailed process of configuring the MySQL dat...
CSS style rule syntax style is the basic unit of ...
1. Use .gifs rather than .jpgs. GIFs are smaller ...
I don't know if you have noticed when making a...
The following three methods are commonly used to d...
<br />User experience is increasingly valued...
The effect achievedImplementation Code html <d...
Table of contents What is ReactHook? React curren...
Scenario Description In a certain system, the fun...
Preface: Recently I am going to team up with my p...
A WeakMap object is a collection of key/value pai...
Table of contents 1. Computed properties Syntax: ...
In some scenarios, we want to assign multiple IPs...
On many websites, we have seen the input box disp...