Nginx installation and use (Mac version)

tips: 本人未安装xcode

1. Open the terminal

2. Install brew on mac:

  • Excuting an order:/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  • The official website of brew: http://brew.sh/
  • Common commands of brew:
    • brew update: Check and upgrade.
    • brew outdated: Check whether the installed software is out of date and needs to be upgraded.
    • brew upgrade: Upgrade all installed software. If only a certain software is to be upgraded, just follow it with the software name.
    • brew uninstall 软件名 –force: Uninstall a certain software.
    • brew cleanup: Clean up old versions of all installed software.
      What needs to be explained for the cleanup command is that Brew will not uninstall the old version of the software by default.
    • brew –cache: View the downloaded directory of the installation package of the installed software, and you can clean this directory regularly.
    • brew info 软件名: Query information about a certain installed software.

3. If the following is prompted, click Install:

insert image description here

4. Enter brew -vthe command, if the problem in Figure 1 occurs, follow the prompts to execute the command in Figure 2:

insert image description here

insert image description here

5. Then execute brew install nginxand nginx -v, if you see the following prompt, it means the installation is successful.

insert image description here

6. Execute brew info nginxand view related information:

insert image description here

7. Start nginx:nginx

insert image description here

8. Close nginx:nginx -s stop

9. View the nginx installation directory:open /opt/homebrew

This is 配置文件路径, if you want to change it, enter here:

insert image description here

This is the html file path:

insert image description here

Guess you like

Origin blog.csdn.net/Y1914960928/article/details/128409639