How to install Nginx in FreeBSD
There are two ways of installing Nginx in FreeBSD. You can install Nginx using package system or ports system. The second way is more flexible.
Installing Nginx from package
pkg_add -r nginx
Installing Nginx from ports
cd /usr/ports/www/nginx make install clean
Mark modules you need for your build and press OK.
Activating Nginx
When compilation and installation are finished you can try to start Nginx:
/usr/local/etc/rc.d/nginx onestart
If you want Nginx to start with the system add to /etc/rc.conf:
nginx_enable="YES"
Nginx configuration file is located in /usr/local/etc/nginx/nginx.conf. Nginx default document root directory is in /usr/local/www/nginx.
See also:
- How to set up LEMP Server on Ubuntu 11.04
- NAXSI: protecting websites with Nginx
- How to install Nginx on CentOS
- How to fix the "corrupted record (pkgdep line without argument), ignoring" error in FreeBSD
- How to fix accept() failed (24: Too many open files) error in Nginx
- How to edit fstab in FreeBSD if the system can't boot
Got a comment?