Install nginx under linux

1. Unzip nginx
2. Check the dependency package ./configure
3. Install pcre,
copy the pcre under /usr/local/src,
enter the pcre folder
and execute ./configure to check if the package is missing
Error : configure: error: You need a C++ compiler for C++ support
    install yum install -y gcc gcc-c++
Enter the pcre folder and continue to execute ./configure to
compile pcre Enter the pcre folder to execute make and
execute make install

4. Then enter the nginx folder to execute ./configure
5. If the zlib package is missing, execute : yum -y install zlib-devel
6. Enter the nginx folder and execute ./configure
7. If no error is reported, execute make to compile
8. Execute make install to
install the installation, an nginx folder will be generated under /usr/local
9. Problems with starting Nginx:
#/usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
#ldd $(which /usr/local/nginx/sbin/nginx)
It can be seen that libpcre.so.1 => not found did not find the solution to
enter /usr/local/lib (run directly):
32-bit system [root@sever lib]# ln -s /usr/local/lib/libpcre .so.1 /lib
64-bit system [root@sever lib]# ln -s /usr/local/lib/libpcre.so.1 /lib64
10. Start Nginx:
#/usr/local/nginx/sbin/nginx

Guess you like

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