Linux server deploys Nginx and publishes web projects

1. Download the linux version of nginx

nginx: download

2. Execute after decompression

#Configure configure --prefix represents the installation path, --with-http_ssl_module installs ssl, --with-http_stub_status_module checks the client status of nginx./configure
--prefix=/usr/local/nginx-1.20.2 --with -http_ssl_module --with-http_stub_status_module

If there is no error, execute the sixth step 
3. If there is an error ./configure: error: C compiler is not found execute

  yum -y install gcc gcc-c++ autoconf automake make

4. If there is an error ./configure:error: the http rewrite moudle requires the PCRE library execute

   yum -y install openssl openssl-devel

5. Re-execute the second step after solving the problem

6. #Compile and install nginx
make & make install 
7. Enter the installation directory /usr/local/nginx/sbin to execute

  ./nginx

8. Visit the server ip:80 to check whether the installation is successful

9. Related configuration files are in nginx/conf/nginx.conf

10. Upload the web file to nging/html, and access the index.html page by default

Guess you like

Origin blog.csdn.net/qq_40513633/article/details/127985029