Skip to main content

Posts

Showing posts from 2012

OpenBSD 5.2 - NTP

This is how you can stay sync your server time with the world time from ntp.org Installing from ports: #cd /usr/ports/net/ntp #make install Once install, look for ntp readme # more /usr/local/share/doc/pkg-readmes/ntp-4.2.6pl5p0 $OpenBSD: README,v 1.5 2012/04/22 11:41:55 ajacoutot Exp $ +----------------------------------------------------------------------- | Running ntp-4.2.6pl5p0 on OpenBSD +----------------------------------------------------------------------- Several steps need to be taken to properly configure the NTP daemon. 1. First, create or update the file /etc/ntp.conf.  Several    example configuration files can be found here:      /usr/local/share/examples/ntp 2. Now xntpd can be started with:      /etc/rc.d/xntpd start    Or to start 'xntpd' at every boot, add it to pkg_scripts in    /etc/rc.conf.local. #vi /etc/rc.conf.local Add as following : pkg_scripts="xntpd" Edit /etc/ntp.conf as f

OpenBSD 5.2 - Fetch ports tree

Sometimes we may use some of the ports tree for our usage instead of using the pkg_add method. Default installation, the ports tree is not included and you have to fetch it manually. This is the how-to : for more reliable you can install wget instead of ftp pkg_add -i wget #cd /tmp #wget -c ftp://ftp.openbsd.org/pub/OpenBSD/5.2/ports.tar.gz once done #cd /usr #tar xzvf /tmp/ports.tar.gz Done!

OpenBSD : Installing with custom partition

This is how the disk layout that I would plan for my setup (It's a Virtualbox) / - root : 500m. This will be 'a'. swap : 1G (so we'll always have enough space for a core dump), this will be partition 'b' /usr : 3g, partition d /tmp : 500m (we don't anticipate much use of this), partition e /usr/local : 5g, partition f /usr/X11R6 : 5g, partition g /home : 5g, partition h /var : 5g (that's a lot of system log files), partition j /var/www : rest of disk, partition k You can follow more specific instruction from here : http://www.openbsd.org.my/faq/faq4.html#Moredisklabel

Yet another Nginx story

Last night one of my friend gtalk me and complaining about his vps is slow and lagging. Further checking the process is highly spike where load average: 173.68, 165.51, 146.09 which is abnormal. I'm thinking the MySQL is consuming all the resources and when I try to restart the process it's come to timeout. No chance at all.. I tried to stop httpd, also timeout and kill come to my hand :) kill -9 [processid] After restart httpd, the load is still high around 4 to 6. I plan to replace Apache with latest Nginx and using php-cgi for communicate with PHP. Surprisingly after I start Nginx the process come to 0.35 not even close to 1.. And that how Nginx act as a hero.. yatta~

OpenBSD : Installing Squid

If you don't know what is squid, please don't think that it's a normal squid that live in the sea! Squid is a web proxy / web caching for your gateway/router. The purpose is to cache image,css,js etc that can reduce your router's workload by supplying to the browser directly from your proxy. This can reduce waiting time and make your browsing more fast. Installing # pkg_add -i squid Ambiguous: choose package for squid  a       0:          1: squid-2.7.STABLE9p15          2: squid-2.7.STABLE9p15-ldap          3: squid-2.7.STABLE9p15-ldap-snmp          4: squid-2.7.STABLE9p15-ntlm          5: squid-2.7.STABLE9p15-snmp Your choice: 1 squid-2.7.STABLE9p15: ok                                                                                                                                                         The following new rcscripts were installed: /etc/rc.d/squid See rc.d(8) for details. Look in /usr/local/share/doc/pkg-readmes for extra documenta

OpenBSD 101 - Basic

I got 2 customer that using 2 FreeBSD box serving as their gateway. Both are installed squid to cache their web browsing for the network. It's time to upgrade both of the box, I thinking of using OpenBSD as a gateway to see how OpenBSD perform. I'm working on my virtualbox to test before deploy and implement them :) Basic networking for OpenBSD IP Forwarding: Permanenant: #vi /etc/sysctl.conf Change from: #net.inet.ip.forwarding=1 To net.inet.ip.forwarding=1 You can change it on the spot by issuing the command #sysctl net.inet.ip.forwarding=1 But this will revert to default once you reboot the machine, use permanent then. Setting up IP address : File : /etc/hostname.em0 (depends on your network card) Structure : type address netmask broadcast others #vi /etc/hostname.em0 inet 10.0.0.1 255.255.255.0 NONE Setting interface for DHCP #vi /etc/hostname.em0 dhcp http://www.openbsd.org/faq/faq6.html Once done, restart the ser

MySQL - disable bin log

Suddenly our forum server unexpectedly give a error message like the web server is dead. So further investigation I found that the /var filesystem is full because of some of the log file size is kinda big. So I plan to disable the bin log file from MySQL which I found that it's quite big :) -rw-rw----  1 mysql  mysql   631M Dec 19 01:36:56 2009 mysql-bin.000001 -rw-rw----  1 mysql  mysql   2.3M Dec 22 23:09:47 2009 mysql-bin.000002 -rw-rw----  1 mysql  mysql   8.2K Dec 22 23:15:27 2009 mysql-bin.000003 -rw-rw----  1 mysql  mysql   4.3K Dec 22 23:21:13 2009 mysql-bin.000004 -rw-rw----  1 mysql  mysql   125B Dec 25 14:27:18 2009 mysql-bin.000005 -rw-rw----  1 mysql  mysql   125B Dec 25 16:16:06 2009 mysql-bin.000006 -rw-rw----  1 mysql  mysql   125B Apr 24 00:32:48 2011 mysql-bin.000007 -rw-rw----  1 mysql  mysql   332B Apr 24 00:36:37 2011 mysql-bin.000008 -rw-rw----  1 mysql  mysql   1.0G Apr 25 00:25:21 2011 mysql-bin.000009 -rw-rw----  1 mysql  mysql   1.0G Apr 29 13

CakePHP 2.1 - Blank Screen

Ok I got strange problem in my CakePHP apps, which I encounter a blank screen whenever I submit or delete a data from my form. The weird is this does not happen in my apps which I uploaded to the server. Searching around for any possibilities and I found this ; http://stackoverflow.com/questions/3490780/cakephp-form-submission-results-blank-screen 1- Check config/core.php and set DEBUG to 2. If you are getting a blank screen, this may not do anything. 2- Check your controllers / models. Make sure there is no blank lines after the ending ?> php tag. This could also cause blank screens. 3- Check syntax of your code. Try commenting out code to see if there is some code that may be improperly formed causing syntactical outages. Blank line is the cause of my problem. By removing the extra lines, my problem solved and I can now save or delete my data without any blank screen ! ! horeyy

Hurricane Electric IPv6 with FreeBSD 8.3

Figure out how IPv6 is important nowadays, I got to try and deploy on my server and serve the IPv6 to the world to access. Searching around I've got several option for IPv6 Tunnel Broker. We got Hurricane Electric (HE) , Freenet6 (gogo6) and several others provider but the two provider are the most popular right now. The question ; - Why we deploy an IPv6 ? WHY WE DEPLOY AN IPV6 ? - For me there's no specific answer on this question because it depends on your situation and your needs with IPv6. While we can live with IPv4 , we have to take note that IPv4 allocated address is depreciated and based on HE statistics IPv4 is depreciated on 2012 we don't have any reserved address anymore. If you still want to use IPv4, to allocate the address, you may have to pay more since the address is not much. - IPv6 is the future of the internet address and we have to prepare on that situation which I think it is important. Let say the world will transform from IPv4 to IPv6, and on

FreeBSD :- Nginx , PHP-FPM

One of my forum that I managed previously used Apache as a web server. From my observation Apache with PHP suck a lot of memory resources but that doesn't hang up the server. So google around and I found others using Apache as a proxy using reverse proxy. While Nginx serve as front end web server. The result is good! Nginx still using minimum memory usage! impressive :) But that's does not stop me from searching other solution that best for the forum, and I found solution for Nginx with PHP-FPM (FastCGI Process Manager). Before that I've tried with spawn-fcgi but the process had died repeatedly. Not satisfied with that I've tried PHP-FPM ! Now stick with Nginx + PHP-FPM very satisfied! :)

/dev/null

Wow there's been a long time that I don't write anything in my blog. Real life makes me don't have time to write a long post here.. Some things that have been moving around me : - Just got my new born baby ( Hero) - New company related project to be settle - Wifey continuing her study - bla bla bla.. Speaking of FreeBSD, I've still maintain 3 customer as my part time that using FreeBSD as their gateway / server : - Putera.com - CyberCafe - Protemp Those box are running fine and steady. BSD r0ck!