About the machine:

MacOS: Monterey

Processor: Apple M1 Pro

Download the required dependency packages

Installing Pcre

  1. Download address: sourceforge.net/projects/pc…

    Version selection: /pcre/8.45/ PCRE-8.45.tar.bz2

  2. Unzip and go to the directory

  3. Su root Enter the password

  4. ./configure –help

    Installation directories: –prefix=PREFIX install architecture-independent files in PREFIX [/usr/local]

    By default, make install will install all the files in /usr/local/bin', /usr/local/lib' etc.

    You can specify an installation prefix other than /usr/local' using --prefix', for instance --prefix=$HOME

  5. . / configure — prefix = / Users/XXXX/SourceCode/pcre – 8.45

    If you make && make install without specifying the installation directory, /usr/local will be installed by default

  6. make && make install

  7. make -k check

Install openssl

  1. Download it at www.openssl.org/source/

    Openssl-3.0.0.tar. gz (SHA256) (PGP Sign) (SHA1)

  2. Unzip and go to the directory

  3. Su root Enter the password

  4. ./config –h To learn more about the installation details, open the install.md file.

    Configuring OpenSSL version 3.0.0 for target darwin64-arm64 Using os-specific seed configuration Creating configdata.pm Running configdata.pm Creating Makefile.in Creating Makefile

    *** OpenSSL has been successfully configured ***

    *** If you encounter a problem while building, please open an *** *** issue on GitHub github.com/openssl/ope… *** *** and include the output from the following command: ***

    *** perl configdata.pm –dump ***

    *** (If you are new to OpenSSL, you might want to consult the *** *** ‘Troubleshooting’ section in the INSTALL.md file first) ***

  5. . / config — prefix = / Users/XXXX/SourceCode/openssl – 3.0.0

  6. make && make install

    cp: / Users/XXXXX/Downloads/openssl – 3.0.0 / include/openssl/aes. H and. / include/openssl/aes. H are identical (not copied). The make: *** [install_dev] Error 1

    I tried to configure the following in step 5, but an error was still reported when I executed step 6 again, and the configuration was as follows:

    . / config — prefix = / Users/XXXXX/Downloads/openssl – 3.0.0 – with – zlib – include = / Users/XXXXX/Downloads/openssl – 3.0.0 / openssl – include

    I can understand the mistake and I probably need to specify the copied file somewhere else with a configuration parameter, but scroll throughINSTALL.md I couldn’t find the answer, so let me know in the comments section if you can

  7. Openssl Version Check the version number

    Sh -3.2# openssl version LibreSSL 2.8.3

Install the zlib

  1. Download address: sourceforge.net/projects/li…

  2. Unzip and go to the directory

  3. Su root Enter the password

  4. ./configure –help

    usage: configure [–const] [–zprefix] [–prefix=PREFIX] [–eprefix=EXPREFIX] [–static] [–64] [–libdir=LIBDIR] [–sharedlibdir=LIBDIR] [–includedir=INCLUDEDIR] [–archs=”-arch i386 -arch x86_64″]

  5. . / configure — prefix = / Users/XXXX/SourceCode/zlib – 1.2.11

  6. make && make install

  7. make -k check

Install Nginx

  1. Download address: sourceforge.net/projects/li…

    Download version: nginx-1.20.0.tar.gz

  2. Unzip and go to the directory

  3. Su root Enter the password

  4. ./configure –help

  5. ./configure –conf-path=/usr/local/nginx/nginx.conf –prefix=/Users/xxxxx/SourceCode/nginx – with – pcre = / Users/XXXXX/SourceCode/pcre – 8.45 – with – zlib = / Users/XXXXX/SourceCode/zlib – 1.2.11 – with openssl = / Users/XXXXX/SourceCode/openssl – 3.0.0 – with – http_stub_status_module – with – http_ssl_module

    –conf-path=/usr/local/nginx/nginx.conf

    Typically, a separate place is designated to store configuration files, separate the installation directory from the source directory

  6. make &&make install

    Installation is completed through the soft links to source directory/Users/XXXXX/SourceCode/nginx/sbin/nginx link to the installation directory, may also directly link directory

  7. Modify the nginx.conf file

    Modify only the first line to ensure that the operation is ok. The specific configuration can be adjusted according to the actual development

    Turn on #user nobody and change the bit user root staff

  8. Configuring environment Variables

    Environment variables can be configured before startup

    Such as:

    export NGINX_HOME=/usr/local/nginx export PATH=
    P A T H : PATH:
    NGINX_HOME/bin

    Remember to source

  9. Start the nginx

    nginx -c /usr/local/nginx/nginx.conf

  10. Go to localhost:80