컴퓨터/web

[mac] NGINX brew start error

Hikasiru 2022. 9. 26. 17:48

 

homebrew를 통해서 nginx 실행 시 info를 찍어보면 실행이 안 되고 있다.

 

❯ brew services start nginx
==> Successfully started `nginx` (label: homebrew.mxcl.nginx)
❯ brew services info nginx
nginx (homebrew.mxcl.nginx)
Running: 
Loaded: 
Schedulable: 

 

물론 sudo로 실행시킬 순 있지만 추천하지 않는 방법이니, 아래와 같이 log 폴더의 권한을 변경 해주면 된다.

기존엔 root, 변경 후엔 실행 시키는 user

 

❯ sudo chown -R $(whoami) /usr/local/var/log/nginx
Alias tip: _ chown -R $(whoami) /usr/local/var/log/nginx
Password:

 

❯ brew services start nginx
==> Successfully started `nginx` (label: homebrew.mxcl.nginx)
❯ brew services info nginx
nginx (homebrew.mxcl.nginx)
Running: 
Loaded:
Schedulable: 
User: hikasiru
PID: 39158

 

잘 실행된다.