Official documentation: https://nginx.org/en/linux_packages.html#RHEL-CentOS Installation environment: Linux server CentOS 7.3, Root privileges 1. Install the prerequisites: 2. To set up the yum repository, create the file named /etc/yum.repos.d/nginx.repo with the following contents: (Note to replace the OS version: $releasever, if the centos version is 7, replace it with 7) Order: Edit the nginx.repo file using vim Set up the Nginx yum source: Paste the following content into the nginx.repo file [nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true Enter the vim command: wq to save and exit 3.To install nginx, run the following command: sudo yum install nginx 4. When prompted to accept the GPG key, verify that the fingerprint matches 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62, and if so, accept it. Finally, the fingerprint will be output. If it matches the red part above, enter y to confirm. 5. Start | Stop | Restart Nginx: # Start systemctl start nginx.service # Stop systemctl stop nginx.service # Restart systemctl restart nginx.service 6. View all Nginx installation locations: rpm is the rpm package management tool for Linux. -q stands for query mode, and -l stands for return list. 7. Nginx configuration file: /etc/nginx/conf.d /etc/nginx/conf.d/default.conf Summarize The above is the method of installing Nginx under CentOS introduced by the editor. I hope it will be helpful to everyone! You may also be interested in:
|
<<: Detailed explanation of 4 common data sources in Spark SQL
>>: An example of how Vue implements four-level navigation and verification code
Install Docker Desktop Download address: Docker D...
Several typical values of innodb_flush_method f...
First install the dependent packages to avoid pro...
Solution: Directly in the directory where you dow...
There are many special symbols used in mathematic...
Recently, in order to realize the course design, ...
Table of contents Union query 1. Query the ID and...
Linux environment variable configuration When cus...
Preface As we all know, by default, the MySQL ins...
webkit scrollbar style reset 1. The scrollbar con...
1. Multi-header table code Copy code The code is a...
Now that we have finished the transform course, l...
It is very important to monitor the operating sta...
This seems to be no longer possible with the new ...
This article example shares the specific code of ...