• Domains
  • Web Hosting
  • WordPress Hosting
  • Reseller Hosting
  • Cloud VPS
  • Dedicated Servers
  • Domains
  • Web Hosting
  • WordPress Hosting
  • Reseller Hosting
  • Cloud VPS
  • Dedicated Servers
home/Knowledge Base/Web Servers/Installing Nginx on FreeBSD
Popular Search:Dedicated Server, CentOS, Web Hosting

Installing Nginx on FreeBSD

38 views 0 November 26, 2019 Updated on December 7, 2019 aklwebhost

Update/Install FreeBSD Port Tree

If this is from a fresh installation (and not a CustomISO), then you will likely need to install the port tree. Providing that you have one already, it can be updated by using the following command:

portsnap fetch extract

This may take a few minutes to download, but once it has finished, you will be able to move on to the next step.

Upgrade pkg

To install the ports that were recently downloaded, you will need to upgrade pkg. Run the following command to upgrade pkg:

cd /usr/ports/ports-mgmt/pkg
make reinstall

Once this has finished, you may run the following command to clean the directory of any temporary files:

make clean

Installing Nginx

Similar to the previous step, you will need to run the following commands to configure, compile, and install Nginx.

cd /usr/ports/www/nginx
make config-recursive

You will get a configuration pop up and when you do may want to choose the following: HTTP_GZIP_STATIC, HTTP_SSL, HTTP_DAV_EXT. It may be desirable to enable other modules to be compiled with Nginx. Any of the next pop-ups can be left at the default. Now run the following commands to install Nginx.

make install

Once the installation is complete, you can run the following to clean up the directory from any files created by this step:

make clean 

Configure Autostart

To make nginx start on boot of your server, edit /etc/rc.conf. You can edit this file by running ee /etc/rc.conf. Alternatively, you could use nano. Nano can be installed by running pkg install nano.

In /etc/rc.conf add nginx_enable="YES" to the end of the file. Once this is done, you may proceed to the next step.

Starting Nginx

To start nginx, you may run either:

service nginx start

or

service nginx onestart

Upon success. You should see output similar to the following format:

Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.

To verify that Nginx is configured properly, you can navigate to your IP address in a web browser. Navigate to http://0.0.0.0 (Change IP accordingly). Upon success, you will see the “Welcome to Nginx!” page.

Nginx can be further configured in /usr/local/etc/nginx/.

The default Nginx pages, such as “Welcome to Nginx!” are located in /usr/local/www/nginx/.

Tags:Installing Nginx on FreeBSD

Was this helpful?

Yes  No
Related Articles
  • How To Setup Apache on Windows Server
  • Setting up IIS on Windows Server
  • Setup NGINX, PHP-FPM, and MariaDB on Debian 8
  • Apache Virtual Hosts on Ubuntu 14.04 LTS
  • Radio Streaming on FreeBSD 10 with IceCast and Ices
  • Install Lighttpd with PHP5 and MySQL (LLMP Stack) on Ubuntu 14.04
Leave A Comment Cancel reply

Web Servers
  • Installing Nginx on FreeBSD
  • How To Setup Apache on Windows Server
  • Setting up IIS on Windows Server
  • Setup NGINX, PHP-FPM, and MariaDB on Debian 8
  • Apache Virtual Hosts on Ubuntu 14.04 LTS
  • Install Lighttpd with PHP5 and MySQL (LLMP Stack) on Ubuntu 14.04
View All 37  
Popular Articles
  • Using StrongSwan for IPSec VPN on CentOS 7
  • Disabling SSDP (Linux / Windows)
  • Can I pay by Western Union?
  • Can a Coupon Code Discount Be Carried Forward While I Upgrade My VPS Account
  • Can I pay multiple due invoices using a single transaction?
KB Categories
  • Billing
  • Cloud Hosting
  • CMS Hosting
  • cPanel/WHM Control Panel Guide
  • Dedicated Servers
    • AMD Opteron 6272
    • Arch
    • Backup Storage
    • Bandwidth
    • Basic Security
    • BSD
    • CentOS
    • Containers
    • CoreOS
    • DDoS Protection
    • Debian
    • Dedicated Server Control Panel
    • Intel Core i5 3550
    • Intel Core i5 4570
    • Intel Core i7 3770
    • Intel Core i7 4770
    • Intel Xeon E3 1230 V3
    • Intel Xeon E3 1245 V2
    • IP Space
    • Linux Guides
    • Minecraft
    • Networking
    • Server Apps
    • Server Troubleshooting
    • Ubuntu
    • Windows Guides
    • Windows Server 2008
    • Windows Server 2012
  • Domain Names
  • Email Support Documentation
    • Setup IMAP or POP
    • User Features – How To
    • Webmail – How To
  • FTP (File Transfer Protocol
    • CuteFTP Guide
    • FileZilla Guide
  • Game Servers
  • MySQL and MariaDB
  • Node.js
  • Plesk Web Hosting Guide
  • VPS Server
  • Web Servers

  How to Use Sudo on Debian, CentOS, and FreeBSD

Nginx, PHP-FPM and MySQL setup on OpenBSD 5.6  

  • Privacy Policy
  • Terms of Use
  • © 2022 AKLWEB HOST LLC, All Rights Reserved.

Popular Search:Dedicated Server, CentOS, Web Hosting