.. title: Install Kanboard on FreeBSD .. slug: install-kanboard-on-freebsd .. date: 2015-03-13 17:06:06 UTC .. tags: freebsd, kanboard, nginx .. category: .. link: .. description: .. type: text Install Kanboard on FreeBSD ================================================== Read the `Kanboard installation guide `_ for updated information. This guide focuses on the FreeBSD, nginx, and Kanboard stack. It's tested on 10.1-RELEASE. .. TEASER_END: Read more .. contents:: Install and Configure nginx -------------------------------------------- :: root@host:~# pkg install nginx Enable nginx to start on boot. :: root@host:~# echo nginx_enable="YES" >> /etc/rc.conf Configure nginx. :: root@host:~# nano /usr/local/etc/nginx/nginx.conf Leave everything as is, except the following. Comment out `server` directives as well. :: user www www; worker_processes 4; error_log logs/error.log info; pid logs/nginx.pid; events { worker_connections 1024; } http { ... include /usr/local/etc/nginx/conf.d/*.conf; ... #server { # ... #} ... } Create directories for the Kanboard install. :: root@host:~# mkdir -p /var/www/local-kanboard.com root@host:~# chown www:www /var/www/local-kanboard.com root@host:~# chmod 755 /var/www/local-kanboard.com Create Kanboard `server` in the nginx config. :: root@host:~# mkdir -p /usr/local/etc/nginx/conf.d/ root@host:~# nano /usr/local/etc/nginx/conf.d/local-kanboard_com.conf The config should look something like this. :: server { listen 80; server_name local-kanboard.com; rewrite ^ http://local-kanboard.com$request_uri?; } server { listen 80; server_name local-kanboard.com; server_name_in_redirect off; root /var/www/local-kanboard.com; location ~* ^.+\.(ico|js|gif|jpg|jpeg|png|bmp)$ { expires 30d; } location / { index index.php; } location ~ \.php$ { fastcgi_pass; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/local-kanboard.com$fastcgi_script_name; include fastcgi_params; } location ~ /\.ht { deny all; } } Verify the nginx config is valid. :: root@host:~# nginx -t You may see the following error but you can safely ignore it. It's documented at `nginx error after upgrading `_. You just need to restart nginx to make this error go away. Do not ignore other errors, though. :: nginx: [emerg] mkdir() "/var/tmp/nginx/client_body_temp" failed (2: No such file or directory) Restart nginx. :: root@host:~# /usr/local/etc/rc.d/nginx restart Install and Configure PHP -------------------------------------------- Install PHP and othe required modules. :: root@host:~# pkg install php56 php56-mbstring php56-pdo_sqlite php56-openssl php56-hash php56-ctype php56-session php56-json Enable PHP-FPM to start on boot. :: root@host:~# echo php_fpm_enable="YES" >> /etc/rc.conf Put a sample PHP script that provides all information about the PHP installation. This is not a good idea on a production server but invaluable on a test server. :: root@host:~# sh -c 'echo "" > /var/www/domain.com/index.php' Restart PHP-FPM. :: root@host:~# /usr/local/etc/rc.d/php-fpm restart Install and Configure Kanboard ----------------------------------------------- Download Kanboard, extract it, and configure permissions on the *data* directory. :: root@host:~# cd /var/www/local-kanboard.com/ root@host:~# curl -O http://kanboard.net/kanboard-latest.zip root@host:~# unzip kanboard-latest.zip root@host:~# cd kanboard root@host:~# chown -R www:www data root@host:~# chmod ug+w data Access Kanboard ----------------------------------------------- Add the IP of your web server to your local */etc/hosts* file (or equivalent). For example, :: local-kanboard.com www.local-kanboard.com Browse to http://local-kanboard.com/kanboard and login as admin/admin. Additional Reading ----------------------------------------------- * `How to Install Nginx and PHP-FPM on FreeBSD `_ * `Kanboard Installation `_