Before start you should ensure that you have Command Line Tools installed in your mac. It is part of XCode. You should have it installed and updated.

  • Install Command Line Tools if not exist
  • Install Nginx using Homebrew
  • Test Installation
  • Output should look like this
  • Also you can open http://127.0.0.1:8080 in your browser. You should get the next page 

Nginx installed successful.

I prefer to make configurations for virtual hosts right after webserver installation. You can do the same using following instructions

  • Prepare dirs before making configuration
  • Prepare default content for webpages. Create /var/www/localhost/index.html file with following content
  • Edit Nginx config file /usr/local/etc/nginx/nginx.conf and make it look like this
  • Create /usr/local/etc/nginx/sites-available/default file with following content
  • Make symbolic link to sites-avalable/default into sites-enabled
  • Save files and restart Nginx
  • Check how Nginx works
  • Output should look like this
  • Also you can open your browser with http://localhost. You should see neext

Nginx installed. Next  post will be about Nginx and PHP configurations


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.