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
When developing applications that use a database,...
Today, due to project requirements, js is needed t...
Table of contents 1 What is SSH 2 Configure SSH p...
In the vue scaffolding, we can see that in the ne...
Portainer is a lightweight docker environment man...
I have read a lot of knowledge and articles about...
Installation sequence rpm -ivh mysql-community-co...
CHAR and VARCHAR types are similar, differing pri...
<br />Original text: http://andymao.com/andy...
Table of contents 1. Control the display and hidi...
1. First of all, we need to distinguish between t...
This tutorial shares the process of manually inst...
introduce Vue Router is the official routing mana...
Notice! ! ! select * from user where uid not in (...
#mysql -uroot -p Enter password mysql> show fu...