Due to company requirements, two nginx servers in different locations need to be installed on the same machine. what! I used to install it directly in /user/local/, or yum install nginx in /etc/nginx, what should I do now? After some searching, I finally found some reliable answers. ./configure \ --prefix=directory you want to install to\ --sbin-path=/directory you want to install/nginx \ --conf-path=/directory you want to install/nginx.conf \ --pid-path=/directory you want to install/nginx.pid \ --with-http_ssl_module \ --with-pcre=/usr/local/pcre-8.38 \ --with-zlib=/usr/local/zlib-1.2.11 \ --with-openssl=/usr/local/openssl-1.0.1t make && make install test -d My understanding This is the source code to compile and install nginx. The ./configure step is to set some constants for nginx. And --prefix sets the address of the nginx executable file after compilation. Although there are some tutorials on the Internet, many of them are old and some packages can no longer be found. Then I will share my installation steps. Install nginx to a custom location Install pcre first cd /usr/local/ # Download wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz # Unzip tar -zxvf pcre-8.38.tar.gz cd pcre-8.38 ./configure # Compile make && make install # Remember this installation directory, it will be used later# /usr/local/pcre-8.38 Next is zlib cd /usr/local/ # Download wget http://www.zlib.net/zlib-1.2.11.tar.gz # Unzip tar -zxvf zlib-1.2.11.tar.gz cd zlib-1.2.11 ./configure # Compile make && make install # Remember this installation directory, it will be used later# /usr/local/zlib-1.2.11 ssl This does not need to be compiled, it is simple cd /usr/local/ wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz tar -zxvf openssl-1.0.1t.tar.gz # Remember this installation directory, it will be used later# /usr/local/openssl-1.0.1t Now install Nginx cd /usr/local #Download and decompress wget http://nginx.org/download/nginx-1.4.2.tar.gz tar -zxvf nginx-1.4.2.tar.gz # Note: This is only the source code cd nginx-1.4.2 # Set constants ./configure \ --prefix=/customlocation/\ --sbin-path=/custom location/nginx \ --conf-path=/custom location/nginx.conf \ --pid-path=/custom location/nginx.pid \ --with-http_ssl_module \ --with-pcre=/usr/local/pcre-8.38 \ # The location of the pcre just installed --with-zlib=/usr/local/zlib-1.2.11 \ # The location of the zlib just installed --with-openssl=/usr/local/openssl-1.0.1t # The location of the openssl just installed # Compile make && make install # Important: If not executed, the real nginx file test -d will not be created The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Quickly solve the problem that the mysql57 service suddenly disappeared
>>: WeChat applet realizes multi-line text scrolling effect
When creating a tomcat server on a local eclipse,...
This article example shares the specific code of ...
During the daily optimization process, I found a ...
Table of contents 1. Comments on MySQL primary ke...
Table of contents Preface cause Phenomenon why? A...
Table of contents 1. Introduction 2. Implementati...
Q1: What indexes does the database have? What are...
Preface In current JavaScript, there is no concep...
Recently, when I was using the Linux operating sy...
A few simple Linux commands let you split and rea...
Transactional Characteristics 1. Atomicity: After...
After entering yum in linux, the prompt: -bash: /...
Browser compatibility is the most important part ...
Preface Recently, my computer often takes a long ...
A brief analysis of rem First of all, rem is a CS...