一、非macos系统自带的httpd安装
采用homebrew安装
brew install httpd
安装完成后的配置如下:
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/httpd-2.4.51.arm64_big_sur.bottle.tar.gz
Already downloaded: /Users/huangdan07/Library/Caches/Homebrew/downloads/6bdde48eee3bcc27f1997226ea9626280388f3892ca9f8d03f91ef8f74de2c27--httpd-2.4.51.arm64_big_sur.bottle.tar.gz
==> Reinstalling httpd
==> Pouring httpd-2.4.51.arm64_big_sur.bottle.tar.gz
==> Caveats
DocumentRoot is /opt/homebrew/var/www.
The default ports have been set in /opt/homebrew/etc/httpd/httpd.conf to 8080 and in
/opt/homebrew/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.
To start httpd:
brew services start httpd
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/httpd/bin/httpd -D FOREGROUND
==> Summary