Category Archives: Unix

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 alam@192.168.1.201
alam@192.168.1.201’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 <genesis@istar.ca>
> 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 :-)

Cheap VPS that support FreeBSD, OpenBSD, NetBSD and many more – KVM SSD technology

Since I retire from my old company I don’t have access to FreeBSD server that I manage. I use FreeBSD since version 4.7 till latest version 9.0 (last version when I retire). The only option I do is using VirtualBox.

With less access to server make my memory get weak but I still get my old post here work when I need together with video made. Last week a friend told me about new VPS provider called Vultr that give great deal.

Location

Start from $5/month or you can choose hourly charge you can choose many location available such as Dallas, Chicago, New Jersey, Los Angeles, Seattle, Washington for USA preferred location. Other server location are Amsterdam, London, Frankfurt, Paris, German for Europe vps preferred location or Sydney and Tokyo for Asia consumer (at the of writing I see 14 location available). I hope in future they can add other for Asia, Singapore for example.

vps with 14 location available; support usa, europe and asia region

Operating System

By default Vultr provide two architecture; 32 and 64 bit. Each bit have their own ‘default’ OS like CentOS, Ubuntu, Debian, FreeBSD and Windows. In 64 bit OS section you have ‘custom iso’ section. This section dedicated for other OS that not available on the list. So far I have try install DragonFlyBSD, FreeBSD and OpenBSD and other Linux variant like Slackware, OpenSuse and Fedora using custom iso and working well.

Price

Price scheme also good I my opinion. I can tell my student to do their experiment using this service. They can get more memory with same price as other provide like DigitalOcean (but DO not provide custom iso).

vps default operating system available plus custom iso and snapshot then price option

Custom Iso Service

custom _iso_vps

Vultr provide custom iso that let you use iso with maximum 5192MB in size, that could be DVD size. Very spoiling me and my imagination. I can do my experiment with so many scenario. For example I can deploy linux distribution that specialize in disk management like gparted the followed by install Slackware OS or vice versa start with OS installation then resize the disk with gparted for new swap and more.

Server Type

I see it from benchmark experiment. I can experiment for server recipe that might involve database load balancing, high availability, data server like ftp and multi processor utilization operation.

cheap vps that provide different type of server; performance series, storage series and multicore series

KVM and SSD Technology

I love KVM since I never face problem with it. Using SSD for fast operation and I think I prefer to use VPS than my ‘dedicated’ server that utilize IDE for some work.

Last time I make deposit, the provider match my deposit 1:1. $10 get $10 so I got $20 in my account. Good for one instance for 4 month or I can switch the operating system each month :-)

My friend told me if the provider maybe try to compete with Digital Ocean so they give same price. I don’t care. Competition is good for customer like us. Give more location, good up time and low latency then your customer ‘soul’ is yours ( Mortal Combat ).

Click here to get your box.

MySQL Tuner on FreeBSD 9.2

I just know if mysqltuner is available via ports.

Quick heads up :

# cd /usr/ports/databases/mysqltuner

# make install

# whereis mysqltuner.pl
mysqltuner.pl: /usr/local/bin/mysqltuner.pl

# /usr/local/bin/mysqltuner.pl

>>  MySQLTuner 1.2.0 – Major Hayden <major@mhtx.net>
>>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
>>  Run with ‘–help’ for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:

——– General Statistics ————————————————–
[–] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.34
[OK] Operating on 64-bit architecture

——– Storage Engine Statistics ——————————————-
[–] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[–] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] InnoDB is enabled but isn’t being used
[OK] Total fragmented tables: 0

——– Security Recommendations  ——————————————-
[OK] All database users have passwords assigned

——– Performance Metrics ————————————————-
[–] Up for: 1h 21m 43s (54 q [0.011 qps], 12 conn, TX: 28K, RX: 1K)
[–] Reads / Writes: 84% / 16%
[–] Total buffers: 168.0M global + 2.8M per thread (151 max threads)
[OK] Maximum possible memory usage: 583.2M (5% of installed RAM)
[OK] Slow queries: 0% (0/54)
[OK] Highest usage of available connections: 0% (1/151)
[OK] Key buffer size / total MyISAM indexes: 8.0M/98.0K
[!!] Key buffer hit rate: 50.0% (2 cached / 1 reads)
[!!] Query cache is disabled
[OK] Temporary tables created on disk: 0% (0 on disk / 6 total)
[!!] Thread cache is disabled
[OK] Table cache hit rate: 85% (41 open / 48 opened)
[OK] Open file limit used: 0% (48/11K)
[OK] Table locks acquired immediately: 100% (50 immediate / 50 locks)
[!!] Connections aborted: 25%

——– Recommendations —————————————————–
General recommendations:
Add skip-innodb to MySQL configuration to disable InnoDB
MySQL started within last 24 hours – recommendations may be inaccurate
Enable the slow query log to troubleshoot bad queries
Set thread_cache_size to 4 as a starting value
Your applications are not closing MySQL connections properly
Variables to adjust:
query_cache_size (>= 8M)
thread_cache_size (start at 4)

Interesting…. as I see this job is not just set and forget but must be running regularly to identified a running process.

P.S : my.cnf location can be seen from ps command

# ps -ax | grep mysql
96928 ??  Is       0:00.01 /bin/sh /usr/local/bin/mysqld_safe –defaults-extra-file=/var/db/mysql/my.cnf –user=mysql –datadir=/var/db/mysql –pid-file=/var/db/mysql/
97024 ??  I        0:00.91 /usr/local/libexec/mysqld –defaults-extra-file=/var/db/mysql/my.cnf –basedir=/usr/local –datadir=/var/db/mysql –plugin-dir=/usr/local/li

or if its not exist you can copy one from share

# ls /usr/local/share/mysql | grep my-
my-huge.cnf
my-innodb-heavy-4G.cnf
my-large.cnf
my-medium.cnf
my-small.cnf

 

How to install FreeBSD 10 step by step

Horray, FreeBSD 10 is out and ready to serve as usual :-) .  After getting iso file for i386 I quickly set Virtualbox using memory 512MB and space 20GB plus setting ethernet as Bridge. Fire up start button bring me to installation screen. Major release always excite me and I try to document installation process in case others need it.

Lets get start :

By default Virtualbox will set iso file as first boot device and I get this screen.

install_freebsd10_1

Let the default option or wait for autobot. Press Space to pause and choose other option.

Continue reading

Install PHP on DragonFly BSD

PHP is my another concern when I study an OS. Since many project we did in the past use PHP heavily.  PHP 5.2 is another ‘can’t move on’ requirement for many project of us and available in check list.

DragonFly BSD dports also offer PHP same as I expect :

Checking available PHP version in dports

# whereis php52
php52: /usr/dports/lang/php52
dflybsd# cd /usr/dports/lang && ls -l | grep php
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php-mode.el
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php5
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php5-extensions
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php52
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php52-extensions
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php53
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php53-extensions
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php55
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php55-extensions
drwxr-xr-x  1 root  wheel  0 Jan 16 13:34 php_doc

Nice. In general dports offer PHP  (in time of writing) :

  • PHP 5.4 : located in PHP5 (version 5.4.23)
  • PHP 5.3 (version 5.3.28)
  • PHP 5.5 (version 5.5.7)
  • PHP 5.2 (version 5.2.17)

Install PHP as Apache Module on DragonFly BSD

As I already install Apache MPM Worker previously I want to add PHP capability to web server as module.

I choose PHP 5.2

# cd /usr/dports/lang/php52 && make install

install_apache52_on_dragonflybsd

After installation completed.

Continue reading