Home >Operation and Maintenance >Linux Operation and Maintenance >How to install nginx on linux server
Step 1: Install PCRE pcre-devel and Zlib
PCRE (Perl Compatible Regular Expressions) is a Perl library, including perl Compatible regular expression library. The http module of nginx uses pcre to parse regular expressions, so the pcre library needs to be installed on Linux. pcre-devel is a secondary development library developed using pcre. nginx also requires this library. Command:
yum install -y pcre pcre-devel
The zlib library provides many compression and decompression methods. nginx uses zlib to gzip the contents of the http package, so the zlib library needs to be installed on Centos.
yum install -y zlib zlib-devel
After installing these two, you can install nginx, but if there are problems during installation, you may need to install GCC and OpenSSL. The following commands are provided:
yum install gcc-c++ yum install -y openssl openssl-devel
(Free learning video tutorial sharing :linux video tutorial)
Step 2: Install nginx, 1.14.0
##
wget -c https://nginx.org/download/nginx-1.14.0.tar.gzUnzip and enter the nginx directory
tar -zxvf nginx-1.14.0.tar.gz cd nginx-1.14.0Use the default configuration of nginx
./configureCompile and install
make make installFind the installation path:
whereis nginxEnter the sbin directory, You can see that there is an executable file nginx. Just execute ./ and it will be OK. After running, access the server IP and you can see the nginx welcome page. Recommended related articles and tutorials:
The above is the detailed content of How to install nginx on linux server. For more information, please follow other related articles on the PHP Chinese website!