Vanilla<\/strong><\/a>\u00a0is a simple discussion forum written in PHP. Vanilla source code is publicly hosted on\u00a0Github<\/strong><\/a>. This guide will walk you through the Vanilla installation process on a fresh FreeBSD 12 AKLWEB HOST<\/a><\/strong> server instance using PHP, MariaDB as a database, and Nginx as a web server.<\/p>\n\n\n\n Vanilla Forum recommended software stack:<\/p>\n\n\n\n Check the FreeBSD version.<\/p>\n\n\n\n Ensure that your FreeBSD system is up to date.<\/p>\n\n\n\n Install some basic system administration packages if they are not present on your system.<\/p>\n\n\n\n Create a new user account with your preferred username (we will use Run the Now, switch to your newly created user with NOTE:<\/strong> Replace Set up the timezone.<\/p>\n\n\n\n Install PHP and PHP extensions.<\/p>\n\n\n\n Check the version.<\/p>\n\n\n\n Soft-link Check installed PHP extensions.<\/p>\n\n\n\n Enable and start PHP-FPM.<\/p>\n\n\n\n Install MariaDB.<\/p>\n\n\n\n Check the version.<\/p>\n\n\n\n Start and enable MariaDB.<\/p>\n\n\n\n Run the Log into MariaDB as the root user.<\/p>\n\n\n\n Create a new database and user. Remember the credentials for this new user.<\/p>\n\n\n\n Install Nginx.<\/p>\n\n\n\n Check the version.<\/p>\n\n\n\n Enable and start Nginx.<\/p>\n\n\n\n Configure Nginx for use with Vanilla forum.<\/p>\n\n\n\n Populate the file with the following.<\/p>\n\n\n\n Save the file and exit with COLON<\/kbd>+W<\/kbd>+Q<\/kbd>.<\/p>\n\n\n\n Now we need to include the Run Test the configuration.<\/p>\n\n\n\n Reload Nginx.<\/p>\n\n\n\n Create a document root directory.<\/p>\n\n\n\n Change ownership of the Navigate to the document root directory.<\/p>\n\n\n\nRequirements<\/h2>\n\n\n\n
\n
mbstring<\/code><\/li>\n\n\n\n
curl<\/code><\/li>\n\n\n\n
gd<\/code><\/li>\n\n\n\n
PDO<\/code><\/li>\n\n\n\n
mysqli<\/code><\/li>\n\n\n\n
openssl<\/code><\/li>\n\n\n\n
Before you begin<\/h2>\n\n\n\n
uname -ro\n# FreeBSD 12.0-RELEASE<\/code><\/pre>\n\n\n\n
freebsd-update fetch install\npkg update && pkg upgrade -y<\/code><\/pre>\n\n\n\n
pkg install -y sudo vim unzip wget curl bash socat git unzip<\/code><\/pre>\n\n\n\n
johndoe<\/code>).<\/p>\n\n\n\n
adduser\n\n# Username: johndoe\n# Full name: John Doe\n# Uid (Leave empty for default): <Enter>\n# Login group [johndoe]: <Enter>\n# Login group is johndoe. Invite johndoe into other groups? []: wheel\n# Login class [default]: <Enter>\n# Shell (sh csh tcsh nologin) [sh]: bash\n# Home directory [\/home\/johndoe]: <Enter>\n# Home directory permissions (Leave empty for default): <Enter>\n# Use password-based authentication? [yes]: <Enter>\n# Use an empty password? (yes\/no) [no]: <Enter>\n# Use a random password? (yes\/no) [no]: <Enter>\n# Enter password: your_secure_password\n# Enter password again: your_secure_password\n# Lock out the account after creation? [no]: <Enter>\n# OK? (yes\/no): yes\n# Add another user? (yes\/no): no\n# Goodbye!<\/code><\/pre>\n\n\n\n
visudo<\/code> command and uncomment the
%wheel ALL=(ALL) ALL<\/code> line to allow members of the
wheel<\/code> group to execute any command.<\/p>\n\n\n\n
visudo\n\n# Uncomment by removing hash (#) sign\n# %wheel ALL=(ALL) ALL<\/code><\/pre>\n\n\n\n
su<\/code> command.<\/p>\n\n\n\n
su - johndoe<\/code><\/pre>\n\n\n\n
johndoe<\/code> with your username.<\/em><\/p>\n\n\n\n
sudo tzsetup<\/code><\/pre>\n\n\n\n
Install PHP<\/h2>\n\n\n\n
sudo pkg install -y php72 php72-mbstring php72-curl php72-gd php72-pdo php72-mysqli php72-pdo_mysql php72-json php72-openssl php72-ctype php72-dom php72-hash php72-iconv php72-tokenizer php72-calendar php72-fileinfo php72-session php72-simplexml php72-xml php72-filter<\/code><\/pre>\n\n\n\n
php --version\n# PHP 7.2.14 (cli) (built: Jan 15 2019 01:14:39) ( NTS )\n# Copyright (c) 1997-2018 The PHP Group\n# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies<\/code><\/pre>\n\n\n\n
php.ini-production<\/code> to
php.ini<\/code>.<\/p>\n\n\n\n
sudo ln -s \/usr\/local\/etc\/php.ini-production \/usr\/local\/etc\/php.ini<\/code><\/pre>\n\n\n\n
php -m\n# mbstring\n# curl\n# gd\n# PDO\n# mysqli\n# openssl\n# . . .<\/code><\/pre>\n\n\n\n
sudo sysrc php_fpm_enable=yes\nsudo service php-fpm start<\/code><\/pre>\n\n\n\n
Install MariaDB<\/h2>\n\n\n\n
sudo pkg install -y mariadb102-client mariadb102-server<\/code><\/pre>\n\n\n\n
mysql --version\n# mysql Ver 15.1 Distrib 10.2.19-MariaDB, for FreeBSD12.0 (amd64) using readline 5.1<\/code><\/pre>\n\n\n\n
sudo sysrc mysql_enable=\"yes\" \nsudo service mysql-server start<\/code><\/pre>\n\n\n\n
mysql_secure_installation<\/code> script to improve the security of your installation.<\/p>\n\n\n\n
sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n
mysql -u root -p\n# Enter password:<\/code><\/pre>\n\n\n\n
CREATE DATABASE dbname;\nGRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';\nFLUSH PRIVILEGES;\nexit;<\/code><\/pre>\n\n\n\n
Install Nginx<\/h2>\n\n\n\n
sudo pkg install -y nginx<\/code><\/pre>\n\n\n\n
nginx -v\n# nginx version: nginx\/1.14.2<\/code><\/pre>\n\n\n\n
sudo sysrc nginx_enable=yes\nsudo service nginx start<\/code><\/pre>\n\n\n\n
sudo vim \/usr\/local\/etc\/nginx\/vanilla.conf<\/code><\/pre>\n\n\n\n
server {\n\n listen 80;\n server_name example.com;\n root \/usr\/local\/www\/vanilla;\n index index.php;\n\n location ~* \/\\.git { deny all; return 403; }\n location \/build\/ { deny all; return 403; }\n location \/cache\/ { deny all; return 403; }\n location \/cgi-bin\/ { deny all; return 403; }\n location \/uploads\/import\/ { deny all; return 403; }\n location \/conf\/ { deny all; return 403; }\n location \/tests\/ { deny all; return 403; }\n location \/vendor\/ { deny all; return 403; }\n\n location ~* ^\/index\\.php(\/|$) {\n fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\n try_files $fastcgi_script_name =404;\n set $path_info $fastcgi_path_info;\n fastcgi_param PATH_INFO $path_info;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param SCRIPT_NAME \/index.php;\n fastcgi_param SCRIPT_FILENAME $realpath_root\/index.php;\n fastcgi_param X_REWRITE 1;\n fastcgi_pass 127.0.0.1:9000;\n }\n\n location ~* \\.php(\/|$) {\n rewrite ^ \/index.php$uri last;\n }\n \n location \/ {\n try_files $uri $uri\/ @vanilla;\n }\n\n location @vanilla {\n rewrite ^ \/index.php$uri last;\n }\n\n}<\/code><\/pre>\n\n\n\n
vanilla.conf<\/code> file in the main
nginx.conf<\/code> file.<\/p>\n\n\n\n
sudo vim \/usr\/local\/etc\/nginx\/nginx.conf<\/code> and add the following line to the
http {}<\/code> block.<\/p>\n\n\n\n
include vanilla.conf;<\/code><\/pre>\n\n\n\n
sudo nginx -t<\/code><\/pre>\n\n\n\n
sudo service nginx reload<\/code><\/pre>\n\n\n\n
Install Vanilla forum<\/h2>\n\n\n\n
sudo mkdir -p \/usr\/local\/www\/vanilla<\/code><\/pre>\n\n\n\n
\/usr\/local\/www\/vanilla<\/code> directory to
johndoe<\/code>.<\/p>\n\n\n\n
sudo chown -R johndoe:johndoe \/usr\/local\/www\/vanilla<\/code><\/pre>\n\n\n\n
cd \/usr\/local\/www\/vanilla<\/code><\/pre>\n\n\n\n