DragonFlyBSD pkg : initial impression

After use pkg in FreeBSD 10 and very satisfied with the result I feel curious about its brother, DragonFlyBSD.

I install DragonFlyBSD 3.8.2 using 32 bit inside my virtualbox ( I think its same if I run with vps that provide custom iso like vultr).

After configure ssh server for network access, I start test pkg command :

$ ssh [email protected]
[email protected]’s password:
Last login: Tue Oct 21 08:17:01 2014
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California.  All rights reserved.

DragonFly v3.8.2-RELEASE (GENERIC) #7: Thu Aug 14 21:26:32 PDT 2014

Welcome to DragonFly!

To erase a line you’ve written at the command prompt, use “Ctrl-U”.
— Dru <[email protected]>
> su
dflybsd#

# pkg update
Updating repository catalogue
pkg: http://mirror-master.dragonflybsd.org/dports/dragonfly:3.8:x86:32/LATEST/meta.txz: Not Found
pkg: repository Avalon has no meta file, using default settings
Fetching digests.txz: 100% of 977 KB
Fetching packagesite.txz: 100% of 4 MB

Adding new entries: 100%
Incremental update completed, 20921 packages processed:
0 packages updated, 0 removed and 20921 added.
dflybsd# pkg info

bind98-9.8.7P1_5               BIND DNS suite with updated DNSSEC and DNS64
ca_root_nss-3.16.1             The root certificate bundle from the Mozilla Project
cdrtools-3.00_2                CD/DVD/BluRay and ISO-9660 image creation and extraction tools
curl-7.37.1_2                  Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers
cvsps-2.1_1                    Create patchset information from CVS
expat-2.1.0_1                  XML 1.0 parser written in C
gettext-0.18.3.1_1             GNU gettext package
git-2.0.2                      Distributed source code management tool
indexinfo-0.2                  Utility to regenerate the GNU info page index
isc-dhcp42-server-4.2.6_2      The ISC Dynamic Host Configuration Protocol server
libxml2-2.9.1_1                XML parser library for GNOME
openssl-1.0.1_13               SSL and crypto library
pkg-1.3.6                      Package manager

#

Preinstalled package after I type pkg update is more than FreeBSD offer but I like it, I have git, curl and bind out of box 🙂

See what version of compiler DragonFlyBSD use

# cc -v
Using built-in specs.
COLLECT_GCC=/usr/libexec/gcc47/cc
Target: i386-pc-dragonflybsd
Configured with: DragonFly/i386 system compiler (c, c++, objc, LTO)
Thread model: posix
gcc version 4.7.3 [DragonFly] Release/2013-04-11

Try find wordpress

# pkg search wordpress

de-wordpress-3.8
ja-wordpress-3.8.1
p5-WordPress-XMLRPC-1.23
ru-wordpress-3.8.1
wordpress-3.8.1,1
zh-wordpress-zh_CN-3.8.1
zh-wordpress-zh_TW-3.8.1

Looks like the version is bit out date but not big problem for me as wordpress provide easy upgrade procedure.

Good news for me is PHP also available in 5.2 version.

Try install it via pkg

# pkg install php52
Updating repository catalogue
pkg: http://mirror-master.dragonflybsd.org/dports/dragonfly:3.8:x86:32/LATEST/meta.txz: Not Found
pkg: repository Avalon has no meta file, using default settings
Avalon repository is up-to-date
All repositories are up-to-date
The following 1 packages will be affected (of 0 checked):

New packages to be INSTALLED:
php52: 5.2.17_15

The process will require 7 MB more space
1 MB to be downloaded

Proceed with this action [y/N]: y
Fetching php52-5.2.17_15.txz: 100% of 1 MB
Checking integrity… done (0 conflicting)
[1/1] Installing php52-5.2.17_15: 100%

I don’t understand about error message above (Avalon has no meta file) so I ignore it 🙂

Looks like I love DragonFlyBSD too. Same pkg and no hard learning curve 🙂

How to install latest WordPress on FreeBSD 10 : enable web server

In my last post I decide to investigate how to install wordpress on FreeBSD 10 (latest version of FreeBSD at the moment). I use two methods of installation; first using ports and second using pkg. After try it myself I prefer to use pkg for future deployment for following reason :

  1. Fast installation; you don’t have to wait for hours as you did with ports.
  2. More secure; you have binary package. No need for compiler stuff installed in my server.

Of course ports can supply you with so many different options with its dialog but as Michael W Lucas said, he prefer to do other job that pay his bills than watch compile process. Me too 🙂

Ok, back to wordpress. Last install is not complete one as I don’t see web server and database.

pkg info result

# pkg info

ca_root_nss-3.17.1             The root certificate bundle from the Mozilla Project
curl-7.38.0_2                  Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers
freetype2-2.5.3_2              Free and portable TrueType font rendering engine
jpeg-8_5                       IJG’s jpeg compression utilities
kbproto-1.0.6                  KB extension headers
libICE-1.0.9,1                 Inter Client Exchange library for X11
libSM-1.2.2_2,1                Session Management library for X11
libX11-1.6.2_2,1               X11 library
libXau-1.0.8_2                 Authentication Protocol library for X11
libXaw-1.0.12_2,2              X Athena Widgets library
libXdmcp-1.1.1_2               X Display Manager Control Protocol library
libXext-1.3.2_2,1              X11 Extension library
libXmu-1.1.2_2,1               X Miscellaneous Utilities libraries
libXp-1.0.2_2,1                X print library
libXpm-3.5.11_2                X Pixmap library
libXt-1.1.4_2,1                X Toolkit library
libpthread-stubs-0.3_6         This library provides weak aliases for pthread functions
libxcb-1.10_2                  The X protocol C-language Binding (XCB) library
libxml2-2.9.1_1                XML parser library for GNOME
pcre-8.35_1                    Perl Compatible Regular Expressions library
php5-5.4.33_1                  PHP Scripting Language
php5-curl-5.4.33_1             The curl shared extension for php
php5-gd-5.4.33_1               The gd shared extension for php
php5-mysql-5.4.33_1            The mysql shared extension for php
php5-tokenizer-5.4.33_1        The tokenizer shared extension for php
php5-xml-5.4.33_1              The xml shared extension for php
php5-zip-5.4.33_1              The zip shared extension for php
pkg-1.3.8_3                    Package manager
png-1.5.18                     Library for manipulating PNG images
printproto-1.0.5               Print extension headers
t1lib-5.1.2_4,1                Type 1 font rasterization library for Unix/X11
wordpress-4.0,1                State-of-the-art semantic personal publishing platform
xextproto-7.3.0                XExt extension headers
xproto-7.0.26                  X11 protocol headers

Lets continue : Continue reading

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     [email protected]:/usr/obj/usr/src/sys/GENERIC  amd64

Continue reading

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     [email protected]:/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 🙂