Linux installation
Log in to the root account, and the server environment is Alibaba Cloud's Cent OS 7.6 version
Execute yum install yum-utils
run vim /etc/yum.repos.d/nginx.repo
enter:
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
then view the source
yum list | grep nginx
See that there is a stable version of the source and confirm that it is correct.
Run the install command
yum install nginx
Enter y during the process to confirm
Check the version, if the version number appears, the installation is successful
nginx -v
You can view the directory with whereis nginx:
nginx: /usr/sbin/nginx /usr/lib64/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz
Mac OS installation
Install homebrew, then nginx installs brew using:
$ brew install nginx
Follow the prompts to install, usually zoo.conf is directly configured.