Thursday, 28 November 2019

Install NGINX in MAC


Open terminal and execute the commmand.
brew install nginx

nginx is installed at /usr/local/etc/nginx

Once the installation is successful, Execute below command to start nginx server.
sudo nginx

$sudo nginx
Password:
$
$
$ps -eaf | grep nginx
    0 26617     1   0 10:14AM ??         0:00.00 nginx: master process nginx
   -2 26618 26617   0 10:14AM ??         0:00.00 nginx: worker process
188003303 26697  2000   0 10:14AM ttys002    0:00.00 grep nginx

How to test whether nginx started successfully or not?

Open the url ‘http://localhost:8080/’ in browser, you can see below kind of screen.


How to stop nginx server?
sudo nginx -s stop

Location of nginx configuration file
/usr/local/etc/nginx/nginx.conf

Note
To have launchd start nginx now and restart at login:
  brew services start nginx
Or, if you don't want/need a background service you can just run:
  Nginx

Previous                                                    Next                                                    Home

No comments:

Post a Comment