MAC 하 nginx 80 포트 솔 루 션
$:brew install nginx
launchd
launchd 에 대한 설명 은 manpage 를 참조 합 니 다. 다음 과 같 습 니 다.
launchd manages processes, both for the system as a whole and for individual users. The primary and preferred interface to launchd is via the launchctl(1) tool which (among other options) allows the user or administrator to load and unload jobs. Where possible, it is preferable for jobs to launch on demand based on criteria specified in their respective configuration files. launchd also manages XPC services that are bundled within applications and frameworks on the system. During boot launchd is invoked by the kernel to run as the first process on the system and to further bootstrap the rest of the system. You cannot invoke launchd directly.
launchd 는 시스템 과 사용자 관리 프로 세 스 에 사 용 됩 니 다. 주로 launchctl 을 통 해 작 동 합 니 다. 사용 자 는 launchd 를 직접 호출 할 수 없습니다.시작 할 때 커 널 에서 launchd 를 호출 하여 첫 번 째 프로 세 스 를 실행 합 니 다.
plist
그리고 우리 가 알 아야 할 것 은 plist 파일 입 니 다.plist 는 property list format 이라는 뜻 으로 애플 이 응용 데 이 터 를 저장 하 는 형식 으로 xml 입 니 다.nginx 에 대응 하 는 plist 파일 을 / usr / local / opt / nginx 에서 찾 을 수 있 습 니 다. 예 를 들 어 제 컴퓨터 에 서 는 homebrew. mxcl. nginx. plist 입 니 다.
그것 의 내용 은 대략 이렇다.
Label
homebrew.mxcl.nginx
RunAtLoad
KeepAlive
ProgramArguments
/usr/local/opt/nginx/bin/nginx
-g
daemon off;
WorkingDirectory
/usr/local
이 파일 을 / Library / LaunchDaemons 에 복사 해 야 합 니 다. ~ / Library / LaunchAgent 라면 괜 찮 지만 차이 가 있 습 니 다.전 자 는 시스템 이 시 작 될 때 시작 하고 후 자 는 사용자 가 로그 인 할 때 시작 합 니 다.이 어 launchctl load - w 를 실행 합 니 다. 다음 과 같 습 니 다.
sudo cp /usr/local/opt/nginx/*.plist /Library/LaunchDaemons sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
마지막 으로 기 계 를 다시 시작 하면 nginx 가 80 포트 에서 작 동 하 는 것 을 발견 할 수 있 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.