How to install Laravel on FreeBSD 9.2

Laravel Shirt - Basic Dark As I have more machine that run FreeBSD 9 I decide to explore the installation process of PHP Framework. I want to start with Laravel as I feel this framework will be suitable with our team requirement. I already have working PHP 5.2.17 with Apache on my FreeBSD 9.2 box so I have to upgrade it to another version. Lets get started :

Checking installed PHP, MySQL and  Apache

Check PHP

# pkg_info | grep php
php52-5.2.17_15     PHP Scripting Language
php52-ctype-5.2.17_15 The ctype shared extension for php
php52-curl-5.2.17_15 The curl shared extension for php
php52-dom-5.2.17_15 The dom shared extension for php
php52-extensions-1.3_1 A “meta-port” to install PHP extensions
php52-filter-5.2.17_15 The filter shared extension for php
php52-gd-5.2.17_15  The gd shared extension for php
php52-hash-5.2.17_15 The hash shared extension for php
php52-iconv-5.2.17_15 The iconv shared extension for php
php52-json-5.2.17_15 The json shared extension for php
php52-pcre-5.2.17_15 The pcre shared extension for php
php52-pdo-5.2.17_15 The pdo shared extension for php
php52-pdo_mysql-5.2.17_15 The pdo_mysql shared extension for php
php52-pdo_sqlite-5.2.17_15 The pdo_sqlite shared extension for php
php52-posix-5.2.17_15 The posix shared extension for php
php52-session-5.2.17_15 The session shared extension for php
php52-simplexml-5.2.17_15 The simplexml shared extension for php
php52-spl-5.2.17_15 The spl shared extension for php
php52-sqlite-5.2.17_15 The sqlite shared extension for php
php52-tokenizer-5.2.17_15 The tokenizer shared extension for php
php52-xml-5.2.17_15 The xml shared extension for php
php52-xmlreader-5.2.17_15 The xmlreader shared extension for php
php52-xmlwriter-5.2.17_15 The xmlwriter shared extension for php

Check MySQL

# pkg_info | grep mysql
mysql51-client-5.1.72 Multithreaded SQL database (client)
mysql51-server-5.1.72 Multithreaded SQL database (server)
php52-pdo_mysql-5.2.17_15 The pdo_mysql shared extension for php

Check Apache

# pkg_info | grep apache
apache22-2.2.26     Version 2.2.x of Apache web server with prefork MPM.

Upgrade PHP and the Extensions

According to Laravel documentation, PHP version needed for Laravel 4 is PHP >=5.3.7

# cd /usr/ports/lang/ && ls | grep php

More in PHP5 port

# cat php5/Makefile | more

# Created by: Alex Dupre <>
# $FreeBSD: lang/php5/Makefile 330741 2013-10-18 12:37:45Z ale $

PORTNAME=       php5
PORTVERSION=    5.4.21
CATEGORIES?=    lang devel www
MASTER_SITE_SUBDIR=     distributions

Ok, I’ll choose PHP5 port only as this version will give me PHP 5.4.21 which is supported by Laravel and also supported by specific package such as Laravel 4 Generator by Jeffery Way.

Delete older PHP 5.2

# pkg_delete -vx php52

Install PHP 5.4

# cd /usr/ports/lang/php5 && make install


Choose options; CLI, Apache module and LINKTHR.

Check PHP version after install

# php -v
PHP 5.4.21 (cli) (built: Dec 17 2013 13:07:34)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

ok, continue with PHP extensions

# cd /usr/ports/lang/php5-extensions && make install

Choose same as old process (PHP 5.2 install) + Mcrypt.


Restart Apache

# service apache22 restart
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 789.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.


At this stage we have working Apache, MySQL and PHP on FreeBSD 9.2

Install Composer & Laravel

Download Composer

I use snapshot version of Composer

# wget -c

# ln -s /home/alam/composer.phar /usr/local/bin/composer

# chmod 755 composer.phar

Download Laravel

# wget -c --no-check-certificate

Unzip Laravel

# unzip

Move Laravel to documentroot

# mv /home/alam/laravel-master /usr/local/www/apache22/data/laravel

Open composer.json

# cd /usr/local/www/apache22/data/laravel/ && ee composer.json

Add Jeffery Way Generator

“name”: “laravel/laravel”,
“description”: “The Laravel Framework.”,
“keywords”: [“framework”, “laravel”],
“license”: “MIT”,
“require”: {
“laravel/framework”: “4.1.*”,
“way/generators”: “dev-master”


Install Laravel through Composer

# cd /usr/local/www/apache22/data/laravel/

# composer install

All files will be download and when ready you can access it like previous how to.

Picture from : Laravel Shirt – Basic Dark by titeyado

Install Varnish with Apache on FreeBSD 9.2

Today I want to try to install Varnish on FreeBSD. A few scenarios  on my mind. Install varnish with nginx, lighttpd or cherokee with different port under Apache as front end. Due to lack of experience with Varnish I’ll start with Varnish using Apache first. Others will follow :-)

Lets get started

Check Apache installation

# pkg_info | grep apache
apache22-2.2.26     Version 2.2.x of Apache web server with prefork MPM.

Check location of varnish

# whereis varnish
varnish: /usr/ports/www/varnish

Install varnish

# cd /usr/ports/www/varnish && make install


This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.

This port has installed the following startup scripts which may cause
these network services to be started at boot time.

If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type ‘make deinstall’
to deinstall the port if this is a concern.

For more information, and contact details about the security
status of this software, see the following webpage:

Check it

# pkg_info | grep varnish
varnish-3.0.4       The Varnish high-performance HTTP accelerator

Configure Varnish

Add varnish on rc.conf

# echo 'varnishd_enable=YES' >> /etc/rc.conf

Starting Varnish

# /usr/local/etc/rc.d/varnishd start
Starting varnishd.
Classic hash: 16383 buckets

Check if varnish really run?

# /usr/local/etc/rc.d/varnishd status
varnishd is not running.


View varnish configuration

# ee /usr/local/etc/varnish/default.vcl

Inside the file I see these :

 # Default backend definition.  Set this to point to your content
# server.
# backend default {
#     .host = “”;
#     .port = “8080”;
# }

It means the content need to run on port 8080.

Remove all # mark to be like this :

backend default {
.host = “”;
.port = “8080”;

save the file.

Change apache configuration to run on port 8080.

# ee /usr/local/etc/apache22/httpd.conf


Listen 80


Listen 8080

save the fle.

Restart apache

# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 770.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.

# ps -ax | grep httpd
944 ??  Ss    0:00.11 /usr/local/sbin/httpd -DNOHTTPACCEPT
945 ??  S     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
946 ??  I     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
947 ??  I     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
948 ??  I     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
949 ??  I     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT

Retry to run varnish

# /usr/local/etc/rc.d/varnishd start
Starting varnishd.
Classic hash: 16383 buckets

Check varnish
# ps -ax | grep varnish
963 ??  Ss    0:00.00 varnishd: Varnish-Mgr (varnishd)
964 ??  S     0:00.03 varnishd: Varnish-Chld (varnishd)
966  0  R+    0:00.00 grep varnish

Check Varnish

Check via phpinfo file, I can see it run on Varnish :


Interesting. I’ll continue this experiment with different web server as soon as possible.

See you.

P.S : you can enable varnish log

# echo 'varnishlog_enable=YES' >> /etc/rc.conf
# /usr/local/etc/rc.d/varnishlog start
Starting varnishlog.

Top 10 Cool FreeBSD T-Shirt, Hat and Mug

Hobbies at once paid is a luxury that should be in grateful. One of the hobbies that I like is learning the FreeBSD operating system. Many meet new friends, exchange the latest information and so forth. One nice thing also is when meeting with a friend who had the same hobbies.
Accessories are usually the mainstay of commonly used t-shirts, hats and mugs. Some friends ask me where can buy plus accessory can be custom fit if you wish, eg adding our name.

Search results bring into some design t-shirts, hats and mugs that can be seen below:

FreeBSD Big Logo T-ShirtsFreeBSD Big Logo T-ShirtsCHECK PRICE

FreeBSD Logo white T-ShirtFreeBSD Logo white T-ShirtCHECK PRICE

FreeBSD in your heart T-ShirtFreeBSD in your heart T-ShirtCHECK PRICE

FreeBSD Linux T-ShirtFreeBSD Linux T-ShirtCHECK PRICE

FreeBSD Big Logo wihout textFreeBSD Big Logo wihout textCHECK PRICE



 Why those FreeBSD stuff are cool

FreeBSD Big Logo T-Shirts – Big logo of FreeBSD with text “freeBSD” under the image. Looks cool.

FreeBSD Logo white T-Shirt – White T-Shirt with FreeBSD logo with text “freeBSD” next to the image.

FreeBSD in your heart T-Shirt – Good looking T-shirt with small FreeBSD logo along the text.

FreeBSD Linux T-Shirt – Quote what Linus Torvald said “if 386BSD had been availble when I started on Linux, Linux would probably never had happened”. FreeBSD Logo above the quote.

FreeBSD Big Logo wihout text – If you looking for Logo only T-Shirt then you’ll love this one.

FreeBSD Hat – Cool hat, if you going to hang out with your friend. Computer club meeting etc.

FreeBSD Mug – Good companion when you have ‘challenge’ in front of your monitor. Just coffe please :-)

Install php 5.2.17 on FreeBSD 9.2

Mysql Apache Linux PHP Mugs
Another server came and the requirement still same. PHP 5.2.17 is a must. I only have 2 options from the vendor; using ubuntu or freebsd.

Its 2013 and all support for php 5.2 on ubuntu server already gone. I have one option left for this job. FreeBSD. Since my last work with FreeBSD I also think FreeBSD 9.2 already throw PHP 5.2 but I’ll try it first.

Install Ports, PHP 5.2.17, Apache 2.2 and MySQL Server 5.1

# portsnap fetch

Looking up mirrors… 7 mirrors found.
Fetching public key from… done.
Fetching snapshot tag from… done.
Fetching snapshot metadata… done.
Fetching snapshot generated at Mon Nov 25 07:07:20 WIT 2013:

# portsnap extract

Install latest supported PHP 5.2

# cd /usr/ports/lang/php52

Choose required stuff, Apache as web server.


===>   NOTICE:

This port is deprecated; you may wish to reconsider installing it:

PHP 5.2 series is strongly discouraged for new  installations, migrate now.

It is scheduled to be removed on or after 2014-03-01.

Wew. At least it work for my job now :-)

For apache selection, let it as is.


Install PHP Extensions

# cd /usr/ports/lang/php52-extensions && make install

choose extensions that you like. ( I pick MySQL, Curl, GD beside default options).

Tips : add WITHOUT_X11=yes to /etc/make.conf to prevent system install X11 related software.

Install MySQL Server

# cd /usr/ports/databases/mysql51-server && make install


Add service to /etc/rc.conf :

# echo mysql_enable=YES >> /etc/rc.conf

# echo apache22_enable=YES >> /etc/rc.conf

Starting Service

# /usr/local/etc/rc.d/mysql-server start
Starting mysql.

Add php handler

# ee /usr/local/etc/apache22/httpd.conf

Make sure these lines exists :

LoadModule php5_module        libexec/apache22/

in load module list

DirectoryIndex index.php index.html

in IfModule dir_module

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

inside IfModule mime_module directive.

# /usr/local/etc/rc.d/apache22 start
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.


Create php script

# ee /usr/local/www/apache22/data/info.php

put these lines :



Open via lynx

lynx localhost/info.php

then I get


Picture source : Mysql Apache Linux PHP Mugs by Zerotees

Get bootstrap manual for offline reading

Bootstrap CSS Framework Purple T-Shirt I’m programmer and not designer. That is my main reason to use css framework. To speed up development, specially in early development phase. Feature change and so on, no need to get polished and clean interface. Just simple but logic presentation. Bootstrap come to rescue and since version 3 the documentation is lack and force me to read online. I read offline documentation and the doc say about install it using bower. I try to document the process :

Install node

$ cd
$ git clone git://
$ cd node
$ ls

android-configure  ChangeLog        deps     Makefile   test
AUTHORS            common.gypi      doc      node.gyp   tools
benchmark          configure        lib  vcbuild.bat
BSDmakefile  LICENSE  src

$ ./configure

{ ‘target_defaults’: { ‘cflags’: [],
‘default_configuration’: ‘Release’,
‘defines’: [‘OPENSSL_NO_SSL2=1’],
‘include_dirs’: [],
‘libraries’: []},
‘variables’: { ‘clang’: 0,
‘gcc_version’: 47,
‘host_arch’: ‘ia32’,
‘node_install_npm’: ‘true’,
‘node_prefix’: ”,
‘node_shared_cares’: ‘false’,
‘node_shared_http_parser’: ‘false’,
‘node_shared_libuv’: ‘false’,
‘node_shared_openssl’: ‘false’,
‘node_shared_v8’: ‘false’,
‘node_shared_zlib’: ‘false’,
‘node_tag’: ”,
‘node_use_dtrace’: ‘false’,
‘node_use_etw’: ‘false’,
‘node_use_mdb’: ‘false’,
‘node_use_openssl’: ‘true’,
‘node_use_perfctr’: ‘false’,
‘python’: ‘/usr/bin/python’,
‘target_arch’: ‘ia32’,
‘uv_parent_path’: ‘/deps/uv/’,
‘uv_use_dtrace’: ‘false’,
‘v8_enable_gdbjit’: 0,
‘v8_enable_i18n_support’: 0,
‘v8_no_strict_aliasing’: 1,
‘v8_optimized_debug’: 0,
‘v8_random_seed’: 0,
‘v8_use_snapshot’: ‘true’}}
creating  ./config.gypi
creating  ./

$ sudo make install

check version

$ npm -v

Install Bower

$ sudo npm install -g bower

Install Bootstrap

$ bower install bootstrap

Check ruby and install Jekyll

$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-linux]

$ sudo gem install rdoc
$ sudo gem install jekyll

Successfully installed jekyll-1.3.0
1 gem installed
Installing ri documentation for jekyll-1.3.0…
Installing RDoc documentation for jekyll-1.3.0…

Generate Bootstrap Documentation

$cd bower_components/bootstrap

$jekyll serve
Configuration file: /home/alamsyah/bower_components/bootstrap/_config.yml
Source: /home/alamsyah/bower_components/bootstrap
Destination: ./_gh_pages
Generating… done.
Server address:
Server running… press ctrl-c to stop

Open browser and type : lcoalhost:9001


Voila. I got offline version of Bootstrap documentation.

Picture : Bootstrap CSS Framework Purple T-Shirt by adamcoulombe187