아파치(httpd) 와 Nginx 를 맥에서 설치하는 방법입니다.
편의성을 위해 두개 중 하나만 설치하고 사용해야 합니다. (포트가 중복되면 같이 사용 불가)
두 방법 모두 homebrew 를 설치해야합니다.
brew install httpdDocumentRoot 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 restart httpd after an upgrade:
brew services restart httpd
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/httpd/bin/httpd -D FOREGROUNDbrew services start httpd접근은 127.0.0.1:8080 으로 하거나, localhost:8080으로 진행하면 됩니다.
code /opt/homebrew/etc/httpd/httpd.conf만약 포트를 수정하고싶다면 위의 명령어를 입력하여 (vs code 설치 필요)
포트를 수정할 수 있습니다.
brew install nginxDocroot is: /opt/homebrew/var/www
The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /opt/homebrew/etc/nginx/servers/.
To restart nginx after an upgrade:
brew services restart nginx
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/nginx/bin/nginx -g daemon off;brew services start nginx접근은 127.0.0.1:8080 으로 하면 됩니다.
nginx -V/opt/homebrew/etc/nginx/라라벨의 경우 라라벨 발렛 을 활용하여 호스트 설정을 할 수 있습니다.