How to install WordPress on FreeBSD 10

As one of the famous content management system WordPress is one my favourite since 2007 (this blog use serendipity , blogspot custom domain then change to wordpress) and stick to it till now. For me this software is simple to use and I can handle the maintenance.

This time I’ll show how to install wordpress on FreeBSD 10 using two methods : ports and pkg way.

For this purpose I use FreeBSD 10 provided by vultr. I use 768 MB VPS located on New Jersey.

Update FreeBSD

# freebsd-update fetch

# freebsd-update install

# uname -a

FreeBSD wordpress.rasyid.net 10.0-RELEASE-p9 FreeBSD 10.0-RELEASE-p9 #0: Mon Sep 15 14:35:52 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

read more »

FreeBSD Old ISO

I just knew if FreeBSD 10 use Clang by default last time I try to compile HHVM on FreeBSD 10. Since I know nothing about this stuff I prefer to look back for older version when necessary. Quite surprise for me that FreeBSD have their collection since version 1.

I only have 32 machine so I rather stay with it and love this folder. Due to vps provider policy I slowly move to 64 bit to make sure everything went fine. So 64 bit version of old FreeBSD also in my list.

For long time ago I use provider such rootbsd for testing experiment purpose but now I have much easier way to accomplish my hobby. Vultr provide me access to that old version even only for 64 bit architecture.

I can go back to see how FreeBSD looks like when version 5.1 released or step back to 9.2 to implement pkg.

What a beautiful world :-)

Compile HHVM 3.3 on FreeBSD 10

Since HHVM support wordpress I wanna try it on FreeBSD but compile guide for source only available for FreeBSD 8 and downgrade FreeBSD is not an option. Since I have access to vps that capable to run FreeBSD 10 64 bit I decide to take a ride and see how far (hhvm 3.3) and I can go. At least when I have to re-run the test I can see where I fall :-)

Update hostname

#ee /etc/rc.conf

# Auto-Enabled NICs from pc-sysinstall

ifconfig_vtnet0=”inet 104.156.250.192 netmask 255.255.254.0″
defaultrouter=”104.156.250.1″
hostname=”hhvm330.rasyid.net”
sshd_enable=YES
static_routes=linklocal
route_linklocal=”-net 169.254.0.0/16 -interface vtnet0″

save.

# mkdir -p /usr/src/lib/libc/gen

# freebsd-update fetch
# freebsd-update install

update pkg

# pkg update
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest, please wait…
Verifying signature with trusted certificate pkg.freebsd.org.2013102301… done
Installing pkg-1.3.8_3: 100%
Message for pkg-1.3.8_3:
If you are upgrading from the old package format, first run:

# pkg2ng
Updating FreeBSD repository catalogue…
Fetching meta.txz: 100%   944 B   0.9k/s    00:01
Fetching digests.txz: 100%    2 MB   2.1M/s    00:01
Fetching packagesite.txz: 100%    5 MB   5.3M/s    00:01
Processing new repository entries: 100%
FreeBSD repository update completed. 23551 packages processed:
0 updated, 0 removed and 23551 added.

# echo '104.156.250.192    hhvm330.rasyid.net ' >> /etc/hosts

#reboot

# uname -a
FreeBSD hhvm330.rasyid.net 10.0-RELEASE-p9 FreeBSD 10.0-RELEASE-p9 #0: Mon Sep 15 14:35:52 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

Ok, lets get started.

Install devel package :

# pkg install git cmake flex bison re2c openssl libxml2 libxslt openldap-client pcre oniguruma boost-libs libmemcached libmcrypt binutils expat mysql56-client wget tbb icu libexecinfo gcc48 gawk git cclient mc autoconf gmake libevent-hiphop sqlite3 lz4 libzip libedit libinotify glog libelf libdwarf unixodbc  gnulibiberty libyaml  jpeg

Add Jemalloc Support

# mkdir -p /usr/src/contrib
# cd /usr/src/contrib/

# git clone https://github.com/jemalloc/jemalloc.git --depth=1
Cloning into ‘jemalloc’…
remote: Counting objects: 181, done.
remote: Compressing objects: 100% (162/162), done.
remote: Total 181 (delta 18), reused 80 (delta 14)
Receiving objects: 100% (181/181), 372.00 KiB | 0 bytes/s, done.
Resolving deltas: 100% (18/18), done.
Checking connectivity… done.
.

Fix for CClient 2007

#cd /usr/local/lib
#ln -s libc-client4.so libc-client.so

Create a directory for build

# mkdir ~/hhvm330
# cd ~/hhvm330/
# mkdir libs

Get latest HHVM code

# git clone git://github.com/facebook/hhvm.git --depth=1
Cloning into ‘hhvm’…
remote: Counting objects: 40962, done.
remote: Compressing objects: 100% (31200/31200), done.
remote: Total 40962 (delta 6408), reused 29798 (delta 5604)
Receiving objects: 100% (40962/40962), 21.38 MiB | 10.27 MiB/s, done.
Resolving deltas: 100% (6408/6408), done.
Checking connectivity… done.
Checking out files: 100% (53350/53350), done.

#cd hhvm

# git submodule update --init --recursive
Submodule ‘third-party’ (https://github.com/hhvm/hhvm-third-party.git) registered for path ‘third-party’
Cloning into ‘third-party’…
remote: Counting objects: 2248, done.
remote: Total 2248 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2248/2248), 6.66 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1118/1118), done.
Checking connectivity… done.
Submodule path ‘third-party’: checked out ’12acbba4c05d8cbe97fe2a94a4a833c0c80e8182′
Submodule ‘folly’ (https://github.com/facebook/folly.git) registered for path ‘folly/src’
Submodule ‘thrift/src’ (https://github.com/facebook/fbthrift.git) registered for path ‘thrift/src’
Cloning into ‘folly/src’…
remote: Counting objects: 7548, done.
remote: Total 7548 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (7548/7548), 3.41 MiB | 0 bytes/s, done.
Resolving deltas: 100% (5746/5746), done.
Checking connectivity… done.
Submodule path ‘third-party/folly/src’: checked out ‘4ecd8cdd6396f2f4cbfc17c1063537884e3cd6b9’
Cloning into ‘thrift/src’…
remote: Counting objects: 8752, done.
remote: Total 8752 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (8752/8752), 4.99 MiB | 0 bytes/s, done.
Resolving deltas: 100% (6319/6319), done.
Checking connectivity… done.
Submodule path ‘third-party/thrift/src’: checked out ‘378e954ac82a00ba056e6fccd5e1fa3e76803cc8’

Configure environment for GCC 4.8

#setenv CC /usr/local/bin/gcc48
#setenv CXX /usr/local/bin/g++48
#setenv CMAKE_PREFIX_PATH `pwd`/../libs

Libmap

#ee /etc/libmap.conf

[hhvm]
libstdc++.so.6 gcc48/libstdc++.so.6

[program]
libstdc++.so.6 gcc48/libstdc++.so.6

save.

Create hhvm binary.

#cd hhvm
#cmake .

…..
…………..
CMake Warning (dev) at CMake/HPHPFunctions.cmake:156 (get_target_property):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run “cmake –help-policy CMP0026” for policy details.  Use the cmake_policy
command to set the policy and suppress this warning.

The LOCATION property should not be read from target “hhvm”.  Use the
target name directly with add_custom_command, or use the generator
expression $<TARGET_FILE>, as appropriate.

Call Stack (most recent call first):
hphp/hhvm/CMakeLists.txt:45 (HHVM_INSTALL)
This warning is for project developers.  Use -Wno-dev to suppress it.

— Configuring done
— Generating done
— Build files have been written to: /root/hhvm330/hhvm

#make

/root/hhvm330/hhvm/third-party/folly/folly/Conv.cpp:89:7: note: in expansion of macro ‘FOLLY_RANGE_CHECK’
FOLLY_RANGE_CHECK(value <= 1,
^
/root/hhvm330/hhvm/third-party/folly/folly/Conv.h:47:21: error: ‘to_string’ is not a member of ‘std’
(__FILE__ “(” + std::to_string((long long int) __LINE__) + “): ”    \
^
/root/hhvm330/hhvm/third-party/folly/folly/Conv.cpp:130:9: note: in expansion of macro ‘FOLLY_RANGE_CHECK’
FOLLY_RANGE_CHECK(false, “Invalid value for bool”);
^
/root/hhvm330/hhvm/third-party/folly/folly/Conv.h:47:21: error: ‘to_string’ is not a member of ‘std’
(__FILE__ “(” + std::to_string((long long int) __LINE__) + “): ”    \
^
/root/hhvm330/hhvm/third-party/folly/folly/Conv.cpp:134:7: note: in expansion of macro ‘FOLLY_RANGE_CHECK’
FOLLY_RANGE_CHECK(false, “Invalid value for bool”);
^
*** Error code 1

Stop.
make[2]: stopped in /root/hhvm330/hhvm
*** Error code 1

Stop.
make[1]: stopped in /root/hhvm330/hhvm
*** Error code 1

Stop.
make: stopped in /root/hhvm330/hhvm

Fiuh… I guess I need a break and wait for another release :-)

Startup memory difference Percona Server vs MariaDB

When browsing for FreeBSD ports on database section I stumbleupon percona server and decide to see whats the difference between pkg and ports :

update pkg

# pkg update
Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
#

update ports

#portsnap fetch
#portsnap extract

pkg and ports give same version :

# cat /usr/ports/databases/percona56-server/Makefile | grep DISTVERSION
DISTVERSION=    5.6.19-67.0
MASTER_SITES=    http://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-${DISTVERSION}/source/tarball/
DISTNAME=    percona-server-${DISTVERSION}

# pkg install percona56-server
Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 2 packages will be affected (of 0 checked):

New packages to be INSTALLED:
percona56-server: 5.6.19.67.0
percona56-client: 5.6.19.67.0

The process will require 121 MB more space.
10 MB to be downloaded.

Proceed with this action? [y/N]: n

Install using pkg will only need 10MB and much faster than ports so I’ll use pkg :-)

Stop MariaDB

# /usr/local/etc/rc.d/mysql.server.sh stop
Shutting down MySQL.. SUCCESS!

Re run pkg install

# pkg install percona56-server
Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 2 packages will be affected (of 0 checked):

New packages to be INSTALLED:
percona56-server: 5.6.19.67.0
percona56-client: 5.6.19.67.0

The process will require 121 MB more space.
10 MB to be downloaded.

Proceed with this action? [y/N]: y

Fetching percona56-server-5.6.19.67.0.txz: 100%    8 MB 117.5k/s    01:13
Fetching percona56-client-5.6.19.67.0.txz: 100%    2 MB 110.0k/s    00:17
Checking integrity… done (0 conflicting)
[1/2] Installing percona56-client-5.6.19.67.0: 100%
===> Creating users and/or groups.
Using existing group ‘mysql’.
Using existing user ‘mysql’.
[2/2] Installing percona56-server-5.6.19.67.0: 100%

Its idle FreeBSD 10 server. Since I don’t know yet equivalent command for ‘free -m’ in FreeBSD I use top and export it to a file (maria for top process list when running mariadb and percona for top process list when running percona).

The result is :

# cat maria

last pid: 48064;  load averages:  0.08,  0.06,  0.07  up 0+01:20:00    14:41:12
23 processes:  2 running, 21 sleeping

Mem: 63M Active, 22M Inact, 89M Wired, 2492K Cache, 59M Buf, 306M Free
Swap: 1024M Total, 10M Used, 1014M Free

PID USERNAME    THR PRI NICE   SIZE    RES STATE    TIME    WCPU COMMAND
48059 mysql        23  52    0   457M 65512K sigwai   0:01   8.98% mysqld
911 alam          1  20    0 17576K  1504K select   0:10   0.00% sshd
779 root          1  20    0 10132K   408K nanslp   0:01   0.00% cron
915 root          1  23    0 10864K  1588K RUN      0:00   0.00% csh
772 root          1  20    0 12864K  1416K select   0:00   0.00% sendmail
908 root          1  20    0 17576K  1340K select   0:00   0.00% sshd
914 alam          1  20    0 10588K     0K wait     0:00   0.00% <su>
591 root          1  20    0 10096K   784K select   0:00   0.00% syslogd
47991 root          1  52    0 10472K  1716K wait     0:00   0.00% sh
912 alam          1  21    0 10476K     0K wait     0:00   0.00% <sh>
48064 root          1  23    0 11236K  1860K RUN      0:00   0.00% top
475 root          1  20    0  9380K    48K select   0:00   0.00% devd
775 smmsp         1  20    0 12864K     0K pause    0:00   0.00% <sendmail>
900 root          1  20    0 10084K   664K ttyin    0:00   0.00% getty
761 root          1  20    0 14816K  1268K select   0:00   0.00% sshd
906 root          1  52    0 10084K   664K ttyin    0:00   0.00% getty
907 root          1  52    0 10084K   664K ttyin    0:00   0.00% getty
901 root          1  52    0 10084K   664K ttyin    0:00   0.00% getty

# cat percona

last pid: 47972;  load averages:  0.02,  0.05,  0.07  up 0+01:19:09    14:40:21
23 processes:  2 running, 21 sleeping

Mem: 308M Active, 74M Inact, 90M Wired, 10M Cache, 59M Buf, 604K Free
Swap: 1024M Total, 65M Used, 959M Free, 6% Inuse

PID USERNAME    THR PRI NICE   SIZE    RES STATE    TIME    WCPU COMMAND
911 alam          1  20    0 17576K  1504K select   0:10   0.00% sshd
779 root          1  20    0 10132K   400K nanslp   0:01   0.00% cron
47962 mysql        23  33    0   612M   379M sigwai   0:01   0.00% mysqld
915 root          1  20    0 10864K  1296K RUN      0:00   0.00% csh
772 root          1  20    0 12864K  1416K select   0:00   0.00% sendmail
908 root          1  20    0 17576K  1340K select   0:00   0.00% sshd
914 alam          1  20    0 10588K     0K wait     0:00   0.00% <su>
591 root          1  20    0 10096K   784K select   0:00   0.00% syslogd
47866 mysql         1  52    0 10472K     0K wait     0:00   0.00% <sh>
912 alam          1  21    0 10476K     0K wait     0:00   0.00% <sh>
47972 root          1  20    0 11236K  1704K RUN      0:00   0.00% top
475 root          1  20    0  9380K    48K select   0:00   0.00% devd
775 smmsp         1  20    0 12864K     0K pause    0:00   0.00% <sendmail>
900 root          1  20    0 10084K   664K ttyin    0:00   0.00% getty
761 root          1  20    0 14816K  1268K select   0:00   0.00% sshd
906 root          1  52    0 10084K   664K ttyin    0:00   0.00% getty
907 root          1  52    0 10084K   664K ttyin    0:00   0.00% getty
901 root          1  52    0 10084K   664K ttyin    0:00   0.00% getty

I see big difference between them specially for percona but I don’t know how they use memory.

p.s :

MariaDB installled from source (MariaDB 10) and Percona Server from pkg on FreeBSD 10 that run from VirtualBox. I think I’ll try it on FreeBSD 10 64 bit on vps.

Programmer T-Shirts

Working as Programmer + Sysadmin is something that I never Imagine before. Look for bug and error while monitoring mysql memory usage using top command is never been easy. The only way to get happy is fix the bug and able to find out how to minimize server load :-)

I’ve seen so many quote around programmer that turn into programmer t-shirts which is good to see in various form. I’ve list it in this post for my future reference when I want to buy one or perhaps a clue for my gift :-)

code.org t-shirts

Keep Calm and Code ON

I'm a Programmer. I write code t-shirt with the word programmer being misspelled multiple times.

I’m a Programmer. I write code t-shirt with the word programmer being misspelled multiple times.

Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots.

Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots.

More

Random features product line. Great humorous products for the computer programmers in your life

Random features product line. Great humorous products for the computer programmers in your life

A Programmer, or application developer, is not an easy job. You have to know a lot of things and perform a lot of tasks. This design is the perfect job description for a programmer. It simply states what a programmer does every day of their career.

A Programmer, or application developer, is not an easy job. You have to know a lot of things and perform a lot of tasks. This design is the perfect job description for a programmer. It simply states what a programmer does every day of their career.

You consider 256 to be a nice, round number. You are annoyed when 10K means 10,000. You start counting from 0. Your sentences end with a semi-colon

You consider 256 to be a nice, round number. You are annoyed when 10K means 10,000. You start counting from 0. Your sentences end with a semi-colon

Programmer n. (proh-gram-er) an organism that turns caffeine and pizza into software

Programmer n. (proh-gram-er) an organism that turns caffeine and pizza into software

Geek T-Shirt

Physics T-shirt on Dark background. With the following words - Physics, Acceleration, Mass, Particles, Thermodynamics, gravity, hawking, big bang, black holes, electromagnetic, maxwell, quantum mechanics, strings, radiation, tesla, force, e=mc2, gas, atom, proton, nuclear, hertz, radiation, gamma , absolute 0, nanotech, orbit, frequency, weight

Physics T-shirt on Dark background. With the following words – Physics, Acceleration, Mass, Particles, Thermodynamics, gravity, hawking, big bang, black holes, electromagnetic, maxwell, quantum mechanics, strings, radiation, tesla, force, e=mc2, gas, atom, proton, nuclear, hertz, radiation, gamma , absolute 0, nanotech, orbit, frequency, weight

Geek by nature, linux by choice

Geek by nature, linux by choice

Error 404 Costume Not Found, Funny and clever Anti-Halloween Geek web programmer t-shirt is great for the guy who refuses to wear a costume.

Error 404 Costume Not Found, Funny and clever Anti-Halloween Geek web programmer t-shirt is great for the guy who refuses to wear a costume.

Hilarious 'Holy Shift! Look at the asymptote on that mother function' Math Geek T-Shirt.

Hilarious ‘Holy Shift! Look at the asymptote on that mother function’ Math Geek T-Shirt.

This is an original t-shirt design that celebrates science and some of the cool equipment you find in a lab. This would be perfect for any science geek.

This is an original t-shirt design that celebrates science and some of the cool equipment you find in a lab

And God said [Maxwell's equations] and there was light.

And God said [Maxwell’s equations] and there was light.