Tutorial on installing nginx in Linux environment

Tutorial on installing nginx in Linux environment

1. Install the required environment

//Install gcc
yum install gcc-c++

//Install PCRE pcre-devel
yum install -y pcre pcre-devel

//Install zlib
yum install -y zlib zlib-devel

//Install Open SSL
yum install -y openssl openssl-devel

2. Create the nginx directory and download the installation package

//Enter the usr/local directory cd /usr/local

//Create nginx directory mkdir nginx

//Enter the nginx directory cd nginx

//Download the tarball wget http://nginx.org/download/nginx-1.13.7.tar.gz

//Unzip tar
tar -xvf nginx-1.13.7.tar.gz

3. Install nginx

//Enter the nginx directory cd /usr/local/nginx/nginx-1.13.7

//Execute the command ./configure

//Execute the make command (if the execution fails, please check whether the first four installed are installed successfully)
make

//Execute the make install command make install

4. Start nginx

//Enter the /usr/local/nginx/sbin directory and enter ./nginx to start nginx
./nginx

//Close nginx
./nginx -s quit or ./nginx -s stop

//Restart nginx
./nginx -s reload

//View the nginx process ps -ef | grep nginx

5. Set to start automatically

//Edit vim /etc/rc.local

//Add this line at the bottom /usr/local/nginx/sbin/nginx

This is the end of this article about the tutorial on installing nginx in Linux environment. For more relevant content about installing nginx in Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to quickly install Nginx in Linux
  • Detailed steps to install Nginx on Linux
  • Correct steps to install Nginx in Linux

<<:  Vue implements partial refresh of the page (router-view page refresh)

>>:  Several methods to execute sql files under mysql command line

Recommend

In-depth explanation of MySQL isolation level and locking mechanism

Table of contents Brief description: 1. Four char...

How to use type enhancement without typingscript

Preface Due to the weak typing of JS, loose writi...

Implementation of Docker container connection and communication

Port mapping is not the only way to connect Docke...

JavaScript ECharts Usage Explanation

I used ECharts when doing a project before. Today...

Detailed steps for configuring virtual hosts in nginx

Virtual hosts use special software and hardware t...

Logrotate implements Catalina.out log rotation every two hours

1. Introduction to Logrotate tool Logrotate is a ...

How to use nginx to access local static resources on Linux server

1. Check whether port 80 is occupied. Generally, ...

Problems encountered in the execution order of AND and OR in SQL statements

question I encountered a problem when writing dat...

Implementing a simple carousel based on JavaScript

This article shares the specific code of JavaScri...

Class in front-end JavaScript

Table of contents 1. Class 1.1 constructor() 1.2 ...

Explore JavaScript prototype data sharing and method sharing implementation

Data Sharing What kind of data needs to be writte...

Understanding of CSS selector weight (personal test)

Copy code The code is as follows: <style type=...