Category Archives: Linux

Linux

Open network access for mysql on ubuntu server

Error message came out when I try to access new vps server :

$ mysql -ubox-p -h box.rasyid.net

Enter password:
ERROR 2003 (HY000): Can’t connect to MySQL server on ‘box.rasyid.net’ (61)

Edit my.cf file :

# nano /etc/mysql/my.cnf

find this line :

bind-address           = 127.0.0.1

add # in the front into

#bind-address           = 127.0.0.1

save and restart mysql.

Re try again :

$ mysql -ubox -p -h box.rasyid.net

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 50
Server version: 5.0.75-0ubuntu10.2 (Ubuntu)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

Linux Unix Work

How to change proxy information on ubuntu server

New motherboard has come and I ask my friend to install Ubuntu Hardy 8.0.4.3 . Everything is fine except proxy section when I try to apt-get update.

# apt-get update

Err http://security.ubuntu.com hardy-security Release.gpg
Could not resolve ’172.88.1.3;3128′
Err http://security.ubuntu.com hardy-security/main Translation-en_US
Could not resolve ’172.88.1.3;3128′
Err http://security.ubuntu.com hardy-security/restricted Translation-en_US
Could not resolve ’172.88.1.3;3128′
Err http://security.ubuntu.com hardy-security/universe Translation-en_US
Could not resolve ’172.88.1.3;3128′

As you see proxy information is incorrect, there is a ; sign not :

read more »

Linux Unix Work

How to change timezone on ubuntu

One of my friend server must get reconfigure its clock each time, specially when the server get reboot after lamp problem.

Until he realized the timezone is different.

Here’s quick way to change it :

# dpkg-reconfigure tzdata

Current default timezone: ‘Asia/Jakarta’
Local time is now:      Sat Oct  3 13:02:53 WIT 2009.
Universal Time is now:  Sat Oct  3 06:02:53 UTC 2009.

Check

# date

Sat Oct  3 13:03:15 WIT 2009

Great, it fix.

Linux

Update Clam Anti Virus Definition Offline

Not everyone has good internet access or have problem with restriction such proxy password, port blocking etc.

That thing also happen  to our division, when we must doing regular maintenance including latest standar operating procedure that implement Clam Anti Virus in System Rescue CD we don’t have internet access due to security policy during attack of clicker worm.

That means no virus definition!

But Anti virus without latest defintion is not good, I took offline solution for update clam anti virus.

Here’ s the steps :

1. Checking clamav version :

clamd -V

ClamAV 0.94.2/8970/Tue Feb 10 02:52:04 2009

2. Clamav provide offline method, we just need to download latest version from here :

http://www.clamav.org/download/cvd

clamav Update Clam Anti Virus Definition Offline

3. Download main.cvd and daily.cvd from computer that has internet access and save it to usb flash disk.

4. Run system rescue cd on computer target.

5. Put USB flash disk on computer target.

6. Run these commands :

Checking flash disk location

fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x6f656f65

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1043     8377866    7  HPFS/NTFS

Disk /dev/sdb: 4043 MB, 4043309056 bytes
255 heads, 63 sectors/track, 491 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x04dd5721

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         492     3948512+   b  W95 FAT32
Partition 1 has different physical/logical endings:
phys=(490, 254, 63) logical=(491, 145, 38)

Well, its located in /dev/sdb1

Mount the flash disk :

mkdir /mnt/flashdisk
mount -t vfat /dev/sdb1 /mnt/flashdisk
cp /mnt/flashdisk/daily.cvd /var/lib/clamav

Done, I use latest main.cvd so I don’t have to update it.

Run clamscan to scan as previous post.

Linux

Linux Kernel 2.6.27 is out : native support for my acer laptop wifi

Yes, huge thanks for atheros support in this kernel.

More changes in summary :

2.6.27 add a new filesystem (UBIFS) optimized for “pure” flash-based storage devices, the page-cache is now lockless, much improved Direct I/O scalability and performance, delayed allocation for ext4, multiqueue networking, an alternative hibernation implementation based on kexec/kdump, data integrity support in the block layer for devices that support it, a simple tracer called ftrace, a mmio tracer, sysprof support, extraction of all the in-kernel’s firmware to /lib/firmware, XEN support for saving/restorig VMs, improved video camera support, support for the Intel wireless 5000 series and RTL8187B network cards, a new ath9k driver for the Atheros AR5008 and AR9001 family of chipsets, more new drivers, improved support for others and many other improvements and fixes.

Full news

Linux

Step by step preparation step for install ubuntu server in vmware

My friend want to install ubuntu server but he little afraid to do that in production server, he ask me to give hint what he should do.

I think using virtualization is enough to give more experience, so I decide to write steps taken for preparation to install ubuntu 8.04 LTS in vmware workstation.

This step by step taken in windows xp with vmware workstation and ubuntu server 8.04 iso :

1. Open Vmware then click :

File -> New -> Virtual Machine

ubuntu server Step by step preparation step for install ubuntu server in vmware

2. Welcome Wizard will show up, click Next.

ubuntu server2 Step by step preparation step for install ubuntu server in vmware

read more »

Linux

Install Bind in ClarkConnect 4 as dns resolver

I used to use djbdns in every situation I have, so far I use it in FreeBSD and Ubuntu server 8.0.4 LTS I always try to install djbdns as first option for dns stuff.

Yesterday I met situation where clarkconnect 4.2 installed as internet gateway in internet cafe, the owner choose clarkconnect as internet gateway for it’s easy of deployment and maintenance.

The problem is dns, current ISP dns seem to work strangely. He ask me to give solution for it. After think for while I decide to learn installing djbdns in clarkconnect but due to time limit I choose to install bind icon smile Install Bind in ClarkConnect 4 as dns resolver

Bind Installation process in Clarkconnect I did :

1. See machine and kernel info

[root@netcafe init.d]# uname -a
Linux netcafe.net1 2.6.18-53.1.13.2.cc #1 SMP Wed Feb 27 18:26:42 EST 2008 i686 i686 i386 GNU/Linux

2. Update and upgrade
read more »

Linux Unix

101 nginx tutorial and articles

I’m bit lazy to read manual and prefer to read it as a case. Nginx is my favourite now, by collecting related tutorial, blog posting and articles I hope I can learn nginx more.

Links I found so far :

  1. Reverse proxy in depth tutorial
  2. Step by step install Engine X (nginx) and php-fpm in FreeBSD
  3. Dreamier Dream Server with Nginx
  4. Setting Up nginx
  5. New Nginx.conf with optimizations
  6. NginxVirtualHostExample
  7. Nginx as a reverse proxy for Apache
  8. WordPress with Apache and NginX
  9. Moving to Nginx
  10. Nginx + PHP + PHP-FPM on Debian Etch 4.0
  11. WordPress + NGINX : plain permalinks without rewrite
  12. HOWTO: Install WordPress on Nginx
  13. NginX Reporting for Duty
  14. How to do your Nginx rewrites on a Multi User WordPress Integrated with BBPress
  15. Rewrite Non-SSL traffic to SSL Virtual Host with Nginx
  16. HOWTO: Configure nginx for Debian / Ubuntu
  17. Nginx Hacking Tips
  18. Tips on Configuring Nginx for Virtual Hosting
  19. Nginx and Memcached, a 400% boost!
  20. Install Nginx On Ubuntu Server 9.04

More links will be add.

Last Update : May 14 2009

Linux

Start gammu service with event.d in Ubuntu Server 8.04

By default when run gammu in Windows I can leave the window by closing it.

Since I must run it in linux I must type and wait :

root@dns:/etc# /gammu 0 –smsd MYSQL /etc/smsdrc
bash: /gammu: is a directory
root@dns:/etc# gammu 0 –smsd MYSQL /etc/smsdrc
Log filename is “/etc/smsdlog”
Press Ctrl+C to stop the program …

Changing inittab instruction in smsdrc file not work for me, searching using google lead me to event.d

Yes, to start gammu in event.d :

root@dns:/etc/event.d# pwd
/etc/event.d
root@dns:/etc/event.d# nano gammu1

Fill this lines :

start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5
stop on shutdown
respawn
exec /usr/local/bin/gammu 0 –smsd MYSQL /etc/smsdrc 2>&1

Save.

Start gammu service :

root@dns:/etc/event.d# start gammu1
gammu1 (start) waiting
gammu1 (start) starting
gammu1 (start) pre-start
gammu1 (start) spawned, process 11626
gammu1 (start) post-start, (main) process 11626
gammu1 (start) running, process 11626

See status of gammu

root@dns:/etc/event.d# status gammu1
gammu1 (start) running, process 11626

Stop gammu process

root@dns:/etc/event.d# stop gammu1
gammu1 (stop) running, process 11626
gammu1 (stop) pre-stop, (main) process 11626
gammu1 (stop) stopping, process 11626
gammu1 (stop) killed, process 11626
gammu1 (stop) post-stop
gammu1 (stop) waiting

See if gammu is running

root@dns:/service# ps ax | grep gammu
11820 ?        Ss     0:00 /usr/local/bin/gammu 0 –smsd MYSQL /etc/smsdrc
11931 pts/0    R+     0:00 grep gammu

Linux

Relaying mail in postfix

We have new server configured, the problem is the ISP.

They not allow port 25 for sending mail.

Fortunately we have another existing postfix server .

After edit main.cf in new server, we can send email through existing server.

The only change to do is :

Edit main.cf, find relayhost line and add existing server hostname

like :

relayhost = mail.rasyid.net

save and restart postfix.

To make sure it works you can see maillog and mailq .

Linux Unix

mod_unique_id: unable to gethostbyname

Yes, that message display when I try to start apache inside my jail box.

 [Thu Jul 10 13:23:41 2008] [alert] mod_unique_id: unable to gethostbyname(”mailserver”)

To resolve this problem, just edit /etc/hosts

add record for ‘mailserver’ entry, like :

::1                     localhost localhost.my.domain
127.0.0.1               localhost localhost.my.domain
172.88.1.5              email.rasyid.com mailserver

Restart apache and test it yourself.