Kamis, 22 Desember 2011

How to Install Easy Hosting Control Panel (EHCP) on Ubuntu

EHCP is a free and open source web hosting control panel. This guide will show you how to install it on Ubuntu server.

Check /etc/apt/sources.list. It should have the following line (replace oneiric with your version).

deb http://archive.ubuntu.com/ubuntu/ oneiric main restricted
deb-src http://archive.ubuntu.com/ubuntu/ oneiric main restricted
deb http://archive.ubuntu.com/ubuntu/ oneiric-updates main restricted
deb-src

Read more How to Install Easy Hosting Control Panel (EHCP) on Ubuntu

How to Fix MTP USB Driver Error

MTP device is used by Samsung Kies application to connect to Samsung mobile phone through PC using USB cable.

This is how to setup your Android phone to use Samsung Kies:

Go to Setting => Application => Development, and then make sure USB Debugging is unchecked.
Connect your phone to PC using USB cable.
Turn on Samsung Kies and it will try connecting to the phone.

But the problem came when I connect my phone to the PC. Windows unable to install driver for MTP device. I tried

Read more How to Fix MTP USB Driver Error

How to Hack WD My Book Live

WD My Book Live is network storage installed with Debian Linux operating system. We can setup this device to be our web server at home. Here are the steps how I did it:

1. Activate SSH
Open browser, and go to http://device_ip/UI/ssh and then enable SSH service.
2. Login to SSH
username: root
default password: welc0me
3. Backup the system and protect udev update
Backup system:
# dd if=/dev/sda bs=15728640 count=1 | bzip2 >

Read more How to Hack WD My Book Live

Selasa, 01 Maret 2011

Read / Write NTFS on Mac OSX

Open Disk Utility:
Applications => Utilities => Disk Utility

Right click partition, and click Information.
Take note the value on Universal Unique Identifier.

Open Terminal:
Applications => Utilities => Terminal

Edit /etc/fstab:
$ sudo nano /etc/fstab

Type in this line into /etc/fstab:
UUID= none ntfs rw

Save the file.
Reboot.

Jumat, 11 Februari 2011

Setup MRTG Squid on Ubuntu 10.10

Install MRTG, Apache2, Squid and SNMP
$ sudo apt-get install apache2 snmpd mrtg snmp-mibs-downloader squid

Configure SNMP

Backup /etc/snmp/snmpd.conf
$ sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak

Create new /etc/snmp/snmpd.conf
$ sudo nano /etc/snmp/snmpd.conf

and key in these lines:
rocommunity  public
syslocation  "Bukit Batok"
syscontact  xxxxxx@yahoo.com
com2sec public localhost public
group public v1 public
group public v2c public
group public usm public
view all included .1
access public "" any noauth exact all none none

Edit /etc/default/snmpd:
$ sudo nano /etc/default/snmpd

and make sure it contains these lines:
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
SNMPDCOMPAT=yes


Configure Squid

Edit /etc/squid/squid.conf
$ sudo nano /etc/squid/squid.conf

and make sure these lines exist:
snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic all

Restart Squid:
$ sudo /usr/sbin/squid -k reconfigure


Configure MRTG

Create configuration file:
$ sudo cfgmaker --global 'WorkDir:/var/www/mrtg' --ifref=name --ifdesc=eth --global 'Options[_]: bits' --output /etc/mrtg.cfg  --snmp-options=:::::1 public@localhost

Edit /etc/mrtg.cfg and make sure these lines exist:
### Global Config Options
WorkDir: /var/www/mrtg
RunAsDaemon: yes
EnableIPv6: no
Options[_]: bits
LoadMIBS: /usr/share/snmp/mibs/SQUID.txt
### Squid Config
Target[proxy-hit]: cacheHttpHits&cacheServerRequests:public@localhost:3401
# If you are using Squid 2.6 or later, uncomment the following line
RouterName[proxy-hit]: cacheUniqName
MaxBytes[proxy-hit]: 100000
Title[proxy-hit]: HTTP Hits
PageTop[proxy-hit]: <H1>proxy Cache Statistics: HTTP Hits/Requests</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>saniya</TD></TR>
   <TR><TD>Maintainer:</TD><TD>kumkum</TD></TR>
   <TR><TD>Description:</TD><TD>Squid Proxy server</TD></TR>
 </TABLE>
Suppress[proxy-hit]: y
LegendI[proxy-hit]:  HTTP hits
LegendO[proxy-hit]:  HTTP requests
Legend1[proxy-hit]:  HTTP hits
Legend2[proxy-hit]:  HTTP requests
YLegend[proxy-hit]: perminute
ShortLegend[proxy-hit]: req/min
Options[proxy-hit]: nopercent, perminute, dorelpercent, unknaszero

Target[proxy-srvkbinout]: cacheServerInKb&cacheServerOutKb:public@localhost:3401
# If you are using Squid 2.6 or later, uncomment the following line
RouterName[proxy-srvkbinout]: cacheUniqName
MaxBytes[proxy-srvkbinout]: 76800
Title[proxy-srvkbinout]: Cache Server Traffic In/Out
PageTop[proxy-srvkbinout]: <H1>Cache Statistics: Server traffic volume (In/Out)</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>saniya</TD></TR>
   <TR><TD>Maintainer:</TD><TD>kumkum</TD></TR>
   <TR><TD>Description:</TD><TD>Squid Proxy server</TD></TR>
 </TABLE>
Suppress[proxy-srvkbinout]: y
LegendI[proxy-srvkbinout]:  Traffic In
LegendO[proxy-srvkbinout]:  Traffic Out
Legend1[proxy-srvkbinout]:  Traffic In
Legend2[proxy-srvkbinout]:  Traffic Out
YLegend[proxy-srvkbinout]: per minute
ShortLegend[proxy-srvkbinout]: b/min
kMG[proxy-srvkbinout]: k,M,G,T
kilo[proxy-srvkbinout]: 1024
Options[proxy-srvkbinout]: nopercent, perminute, unknaszero

Create MRTG index file:
$ sudo indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html

Execute MRTG:
$ env LANG=C /usr/bin/mrtg /etc/mrtg.cfg

MRTG will default graph the data every 5 minutes.
To change this interval into 10 minutes, add this line into mrtg.cfg:
Interval : 10

To view MRTG graphs, go to http://localhost/mrtg/

Rabu, 09 Februari 2011

Notes: Setup Ubuntu Web Hosting

This is my little note on web hosting setup.

- Install Ubuntu Server 10.10
- Setup static private IP address
- Install ehcp hosting control panel: ehcp.net
- Configure ehcp: add domain, add ftp user, modify ehcp dns template, modify external IP
- Upload website source code
- Import website database
- Install smbfs: apt-get install smbfs
- Create samba script
- Check .htaccess
- Check dl.php to follow .htaccess path
- Change file upload setting in php.ini:  upload_max_filesize = 200M
- Change file upload setting in php.ini:  post_max_size = 200M

- Setup cronjob