Category Archives: Work

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 portsnap.FreeBSD.org mirrors… 7 mirrors found.
Fetching public key from ec2-ap-southeast-2.portsnap.freebsd.org… done.
Fetching snapshot tag from ec2-ap-southeast-2.portsnap.freebsd.org… 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.

Selection_019

===>   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.

Selection_020

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

Configuration

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/libphp5.so

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.

Testing

Create php script

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

put these lines :

<?php
phpinfo();
?>

save.

Open via lynx

lynx localhost/info.php

then I get

Selection_023

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://github.com/ry/node.git
$ cd node
$ ls

android-configure  ChangeLog        deps     Makefile   test
AUTHORS            common.gypi      doc      node.gyp   tools
benchmark          configure        lib      README.md  vcbuild.bat
BSDmakefile        CONTRIBUTING.md  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  ./config.mk

$ sudo make install

check version

$ npm -v
1.3.14

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: http://0.0.0.0:9001
Server running… press ctrl-c to stop

Open browser and type : lcoalhost:9001

.Selection_021

Voila. I got offline version of Bootstrap documentation.

Picture : Bootstrap CSS Framework Purple T-Shirt by adamcoulombe187

New Ubuntu Desktop Checklist

Long time no update on this blog. Feeling sad but also get blessed in same time :-)

My old netbook get retired due to battery and screen problem. Windows license attached to my machine also useless on that case. I need to work and decide to get old friend help. Ubuntu desktop. Yes, I also use Ubuntu but for server only when FreeBSD not accepted by client. I need to setup my new environment quickly and make document for future reference.

I use Ubuntu 13.04 with these software :

  1. VirtualBox; I need this software for experiment purpose. Try new OpenBSD, NetBSD and FreeBSD folks. I hope I can create more post :-)
  2. gphpedit; notepad++ replacement . Sublime text is another option but I think its enough at the moment.
  3. Shutter; screenshot tool also need to documentation.
  4. Blue Griffon; wysiwyg html editor. I need it for quick html.
  5. Xampp; apache, mysql and php installer.

Beside the software I need to learn shortcut too. CTRL+ALT+T is my friend for terminal access :-)

Learn MS Access 2003

A client want me to convert their application that use MS Access 2003 to web based application using php and mysql. I agree to do so and this post is just for myself future reference when I have to deal with other MS Access 2003 application.

Open MS Access 2003 in design mode

double click access file, choose block unsafe and click open button when you see ‘security warning’ menu.

while you click open button, make sure to press shift key.

open ms access after choose to block macro

you’ll see the application in design mode (you can access; tables, queries, forms and reports etc under objects)

Fix ‘invalid path error message” when you open ms access 2003 application

open the application and click Tools -> Database Utilities -> Linked Table Manager

 

 

 

 

 

 

 

select the linked tables to be updated and click OK.

wait for a while, new pop up will appear telling if ‘all selected linked tables were successfully refreshed’

Change ms access 2003 application title name

click Tools -> Startup

change application title as seen on the picture and click ok.

Open code editor for ms access 2003 forms

choose forms and click ‘code editor’ icon

new visual basic window will open, you can see the logic there.

convert ms access to mysql

I’ll update the post when I’m done with it.

Update : learn how to convert ms access to mysq step by step.

See you!

How to update / renew Zimbra License

Your Zimbra Network License expired 24 days ago :-)

Yes, that message show up when I log in to one of my client and they ask me to renew the license.

Well, the process itself isn’t difficult as what you need to extend zimbra license just ask sales at zimbra.com.

they will email license key and with the key what you need to do is login to zimbra admin.

Click on Global Settings.

Click License will give this screen.

Click Update License.

Browse for license file and click Next.

Your license file is uploaded successfully.

Click Install.

You license file is installed successfully.

Done.

Client can continue their zimbra mailbox.