Upload the nginx installation package to the server, place it in the /opt/hstech/rpm directory, and execute the installation command.
rpm -ivh nginx-1.20.1-1.el7.ngx.x86_64.rpm
Success as shown in the figure:
start nginx
systemctl start nginx
Add to boot
#查看nginx 是否 开机自启
systemctl list-unit-files | grep nginx
#设置nginx 开机自启
systemctl enable nginx
The picture below is the state without adding the power-on self-start
The picture below shows the success of joining the startup
The default installation location of nginx is in the /etc/nginx directory
Configuration files are in this directory