How to install two nginx under linux system

When installing nginx under linux, it is generally required to set the installation path by prefix in the ./configure stage. Therefore, you can install multiple nginx by specifying different prefixes in ./configure.

It is worth noting that after installation, the listening ports of the two nginx should be set to different listening ports. Otherwise, there will be an nginx that fails to start.

1
2
./configure --prefix=/home/work/nginx1 ..... //第一个nginx的安装配置
make && make install
1
2
./configure --prefix=/home/work/nginx2 ..... //第二个nginx的安装配置
make && make install
1
2
cd /home/work/nginx1/conf/nginx.conf && 修改第一个nginx的监听端口.
./home/work/nginx1/sbin/nginx
1
2
cd /home/work/nginx2/conf/nginx.conf && 修改第二个nginx的监听端口.
./home/work/nginx2/sbin/nginx

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326374424&siteId=291194637