After Nginx is installed, an error is reported.
[Vagrant @ localhost sbin] $ sudo./nginx
./Nginx: error while loading shared libraries: libpcre. so.1: cannot open shared object file: No such file or directory
Run the ldd command to find the Nginx dependent shared library file.
Vagrant @ localhost sbin] $ ldd $ (which/usr/local/nginx/sbin/nginx)
Linux-vdso.so.1 => (0x00007fff1b74a000)
Libpthread. so.0 =>/lib64/libpthread. so.0 (0x00000032b2600000)
Libcrypt. so.1 =>/lib64/libcrypt. so.1 (0x00000032b3a00000)
Libpcre. so.1 => not found
Libcrypto. so.6 =>/lib64/libcrypto. so.6 (0x00000032b4200000)
Libc. so.6 =>/lib64/libc. so.6 (0x00000032b1a00000)
/Lib64/ld-linux-x86-64.so.2 (0x00000032b1600000)
Libdl. so.2 =>/lib64/libdl. so.2 (0x00000032b1e00000)
Libz. so.1 =>/usr/lib64/libz. so.1 (0x00000032b3200000)
The libpcre. so.1 file was not found.
Go to the lib64 directory and make a soft connection to libpcre. so.0.0.1.
[Vagrant @ localhost lib64] $ cd/lib64/
[Vagrant @ localhost lib64] $ sudo ln-s libpcre. so.0.0.1 libpcre. so.1
Run the ldd command again to find the libpcre. so.1 dependent library.
[Vagrant @ localhost lib64] $ ldd $ (which/usr/local/nginx/sbin/nginx)
Linux-vdso.so.1 => (0x00007fffd43d5000)
Libpthread. so.0 =>/lib64/libpthread. so.0 (0x00000032b2600000)
Libcrypt. so.1 =>/lib64/libcrypt. so.1 (0x00000032b3a00000)
Libpcre. so.1 =>/lib64/libpcre. so.1 (0x00000032b1e00000)
Libcrypto. so.6 =>/lib64/libcrypto. so.6 (0x00000032b4200000)
Libc. so.6 =>/lib64/libc. so.6 (0x00000032b1a00000)
/Lib64/ld-linux-x86-64.so.2 (0x00000032b1600000)
Libdl. so.2 =>/lib64/libdl. so.2 (0x00002aebb7623000)
Libz. so.1 =>/usr/lib64/libz. so.1 (0x00000032b3200000)
OK. Now Nginx can be started successfully.
[Vagrant @ localhost sbin] $ sudo./nginx
[Vagrant @ localhost sbin] $ sudo netstat-ntlp | grep nginx
Tcp 0 0 0.0.0.0: 80 0.0.0.0: * LISTEN 17529/nginx