Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":2166,"date":"2019-11-26T06:33:34","date_gmt":"2019-11-26T06:33:34","guid":{"rendered":"https:\/\/support.aklwebhost.com\/?post_type=manual_kb&p=2166"},"modified":"2019-12-07T00:02:57","modified_gmt":"2019-12-07T00:02:57","slug":"installing-nginx-on-freebsd","status":"publish","type":"manual_kb","link":"https:\/\/support.aklwebhost.com\/knowledgebase\/installing-nginx-on-freebsd\/","title":{"rendered":"Installing Nginx on FreeBSD"},"content":{"rendered":"

Update\/Install FreeBSD Port Tree<\/h3>\n

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:<\/p>\n

portsnap fetch extract\r\n<\/code><\/pre>\n

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

Upgrade pkg<\/h3>\n

To install the ports that were recently downloaded, you will need to upgrade\u00a0pkg<\/code>. Run the following command to upgrade\u00a0pkg<\/code>:<\/p>\n

cd \/usr\/ports\/ports-mgmt\/pkg\r\nmake reinstall\r\n<\/code><\/pre>\n

Once this has finished, you may run the following command to clean the directory of any temporary files:<\/p>\n

make clean\r\n<\/code><\/pre>\n

Installing Nginx<\/h3>\n

Similar to the previous step, you will need to run the following commands to configure, compile, and install Nginx.<\/p>\n

cd \/usr\/ports\/www\/nginx\r\nmake config-recursive\r\n<\/code><\/pre>\n

You will get a configuration pop up and when you do may want to choose the following:\u00a0HTTP_GZIP_STATIC, HTTP_SSL, HTTP_DAV_EXT<\/code>. 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.<\/p>\n

make install\r\n<\/code><\/pre>\n

Once the installation is complete, you can run the following to clean up the directory from any files created by this step:<\/p>\n

make clean \r\n<\/code><\/pre>\n

Configure Autostart<\/h3>\n

To make nginx start on boot of your server, edit\u00a0\/etc\/rc.conf<\/code>. You can edit this file by running\u00a0ee \/etc\/rc.conf<\/code>. Alternatively, you could use\u00a0nano<\/code>. Nano can be installed by running\u00a0pkg install nano<\/code>.<\/p>\n

In\u00a0\/etc\/rc.conf<\/code>\u00a0add\u00a0nginx_enable=\"YES\"<\/code>\u00a0to the end of the file. Once this is done, you may proceed to the next step.<\/p>\n

Starting Nginx<\/h3>\n

To start nginx, you may run either:<\/strong><\/p>\n

service nginx start\r\n<\/code><\/pre>\n

or<\/strong><\/p>\n

service nginx onestart\r\n<\/code><\/pre>\n

Upon success. You should see output similar to the following format:<\/strong><\/p>\n

Performing sanity check on nginx configuration:\r\nnginx: the configuration file \/usr\/local\/etc\/nginx\/nginx.conf syntax is ok\r\nnginx: configuration file \/usr\/local\/etc\/nginx\/nginx.conf test is successful\r\nStarting nginx.\r\n<\/code><\/pre>\n

To\u00a0verify that Nginx is configured properly,<\/strong>\u00a0you can navigate to your IP address in a web browser. Navigate to\u00a0http:\/\/0.0.0.0<\/code>\u00a0(Change IP accordingly). Upon success, you will see the\u00a0“Welcome to Nginx!”<\/strong>\u00a0page.<\/p>\n

Nginx can be\u00a0further configured<\/strong>\u00a0in\u00a0\/usr\/local\/etc\/nginx\/<\/code>.<\/p>\n

The default Nginx pages, such as\u00a0“Welcome to Nginx!”<\/strong>\u00a0are located in\u00a0\/usr\/local\/www\/nginx\/<\/code>.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[109,230],"manual_kb_tag":[144],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2166"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2166"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2166\/revisions"}],"predecessor-version":[{"id":2167,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2166\/revisions\/2167"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2166"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2166"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}