An easy way to install two nginx systems on an linux system

  • 2020-05-14 05:46:58
  • OfStack

When installing nginx under linux, 1 will normally require the installation path to be set through prefix in the./configure phase. Therefore, multiple nginx can be installed by specifying different prefix for./configure.

It is worth noting that after installation, the listening ports of the two nginx are set to different listening ports. Otherwise, 1 nginx will fail to start.


./configure --prefix=/home/work/nginx1 .....// The first 1 a nginx Installation configuration 
make && make install

./configure --prefix=/home/work/nginx2 .....// The first 2 a nginx Installation configuration 
make && make install

cd /home/work/nginx1/conf/nginx.conf &&  Modify the first 1 a nginx Listening port of .
./home/work/nginx1/sbin/nginx

cd /home/work/nginx2/conf/nginx.conf &&  Modify the first 2 a nginx Listening port of .
./home/work/nginx2/sbin/nginx

Related articles: