FreeBSD Install Nginx Webserver

by Vivek Gite [Last updated: October 9, 2008]

Q. How do I install Nginix websever under FreeBSD operating systems?

A. nginx [engine x] is a HTTP server, reverse proxy and mail proxy server written by Igor Sysoev. It is a lightweight web server, licensed under a BSD-like license. It the fifth most popular web server.

Update FreeBSD Ports Tree

Type the following command to update FreeBSD tree, enter:
# portsnap fetch update

FreeBSD Install Nginx Web Server

Type the following command to install Nginx web server:
# cd /usr/ports/www/nginx
# make install clean

Fig.01: FreeBSD Nginx Web Server Installation Options

Fig.01: FreeBSD Nginx Web Server Installation Options


Make sure you select important option such as REWRITE_MODULE, SSL_MODULE and others as per your requirements.

Turn on Nginx Webserver

Type the following command to turn on Nginx server
echo 'nginx_enable="YES"' >> /etc/rc.conf
To start Nginx, enter:
# /usr/local/etc/rc.d/nginx start

Important Information about Nginx Webserver

  • Nginx Default configuration file: /usr/local/etc/nginx/nginx.conf
  • Nginx Default http / https port: 80 / 443
  • Nginx Default error log file: /var/log/nginx-error.log
  • Nginx Default access log file: /var/log/nginx-access.log
  • Nginx Default DocumentRoot: /usr/local/www/nginx/

Continue reading rest of the Nginx Webserver Tutorial series (TOC):
  1. FreeBSD Install Nginx Webserver
  2. FreeBSD: Start / Stop / Restart Nginx Web Server
  3. FreeBSD: Nginx FastCGI PHP Configuration
  4. FreeBSD: Nginx Virtual Hosting Configuration
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , , , , , ,

Previous post: Linux LVM error VG meta data inconsistent and Solution

Next post: Linux yum command skip updating packages