Posts Tagged ‘Open Source’

Disable phpinfo() on Apache Web Server

Tuesday, July 22nd, 2008

Information displays from phpinfo() may provide resourceful information to attacker, such as file patch, web server environment, php modules, web server modules and etc. It’s better to disable phpinfo() function on your webserver.

exim, playing with mail queue in server

Monday, July 21st, 2008

there are over thousand emails queue in our mail server, even though I have configured email frozen more than 10 days automatically delete/remove, but it seem like doesn’t work as expected.

here is the work around if you plan to do it manually.

start with listing email queue in the server, by using the command exim -bp, it will list all the email currently queue in the server. but my only concern is frozen email in the server, which I would like to manually clean it from the queue. let try something here,

exim -bp | grep frozen

18d 24K 1JhiI4-00096B-OW <> *** frozen ***
18d 2.3K 1JhiII-00097Y-8s <> *** frozen ***
16d 2.8K 1JhiKM-0009AL-9M <> *** frozen ***
15d 2.3K 1JhiLO-0009Bs-EF <> *** frozen ***
15d 2.5K 1JhiLS-0009Bx-O2 <> *** frozen ***
12d 2.7K 1JhiNm-0009S5-AQ <> *** frozen ***
10d 3.3K 1JhiPv-0009aN-Vu <> *** frozen ***
10d 24K 1JhiQ9-0009as-4R <> *** frozen ***

There are the emails currently queue in the server, and now you might want to check why did the email was queue in the server by exim -Mvl

2008-04-02 15:58:52 Received from <> H=(xxx.xxx.net) [202.76.234.132] P=esmtp S=2143 id=20080402075613.8287E22E8BB@xxx.xxx.net
2008-04-02 15:58:52 routing failed for rsvundet_2002@xxxx.com.my: User account not exist
*** Frozen (delivery error message)

If you want to remove all the email from queue more than 18 days, try this command;

exim -bp | grep 18d | awk ‘{ print $3 }’ | xargs exim -Mrm

Message 1JhiI4-00096B-OW has been removed
Message 1JhiII-00097Y-8s has been removed
Message 1JhiKM-0009AL-9M has been removed
Message 1JhiLO-0009Bs-EF has been removed
Message 1JhiLS-0009Bx-O2 has been removed
Message 1JhiNm-0009S5-AQ has been removed

some usefull queue commands:

-bp : Queue email in Server
-bpc : Count Queue email in Server
-M : Force delivery
-Mar : Add recipient
-Meb : Edit message body
-Mes : Edit sender
-Mf : Freeze message
-Mg : Give up (and bounce message)
-Mmad : Mark all recipients as delivered
-Mmd : Mark recipient as delivered
-Mrm : Remove message (no bounce)
-Mt : Thaw message
-Mvb : View message body
-Mvh : View message header
-Mvl : View message log

enjoy and happy cleaning queue email!

Links

Exim Cheat Sheet by bratthemad
Last update: 20080721

How to Use Wget to Download Manual from Website

Tuesday, July 8th, 2008

Most of the time, we would prefer to read manual offline instead of browsing online, sometime we do not have internet access, and in the boredom, we can read the manual OFFLINE! Example below will show you how to grab the manual online to your machine.

Using wget to Download Website for Offline Reading

If you have wget installed on your machine, you can do the command below to download a website for offline read.


shell> wget --no-parent --mirror -p --convert-links -P ~/Documents/local-browsing http://www.some-website.com/howto/

Above command will download the entire website into your machine in your home directory Document/local-browsing. Now you can read while you are offline!

How to Install FreeBSD 5.4 on Your Machine

Wednesday, October 12th, 2005

FreeBSD is an advanced operating system for x86 compatible (including Pentium® and Athlon ™), amd64 compatible (including Opteron ™, Athlon 64, and EM64T), Alpha/AXP, IA-64, PC-98 and UltraSPARC® architectures. It is derived from BSD, the version of UNIX® developed at the University of California, Berkeley. It is developed and maintained by a large team of individuals. Additional platforms are in various stages of development. Click here to learn more about Unix FreeBSD Operating System.

If you are still new to FreeBSD, here is the step by step installation. For your information, FreeBSD clean installation(developer package) only took 10-15mins(depend on how powerfull is your server/laptop).

First of all, if you have fast/speedy internet connection, grab FreeBSD ISO online from FreeBSD website, it only take you few hours to download with a stable 512kbps internet speed. After you have downloaded FreeBSD ISO DISK1, burn it into a cd.. yes, of course cd, other than CD i can’t any other easier way P Beside that, make the FreeBSD installation CD bootable ok? )

After you boot up with the CD(I won’t cover how to boot up the CD, kind of silly/stupid), immediately you will see the installation menu as figure shown below;

Select Begin Custom installation(for experts), yes are you expert, because you guide by an expert P

Next, let partition your hard disk before the installation, select Partition!

OK, dun be panic see-ing the black and white with text, first, you need to create a “SWAP” partition, how to create a partition? Is an easy job, select the drive and press “C” and it will prompt up a screen as shown below;

Usually SWAP took up (your total RAM) X 2, let said you have total 512MB of RAM in your system, X2 is 1GB. Key in 1G partition and press enter. It’s not done yet, next create a partion again and leave the rest for the space for filesystem. Before you quit, remmeber set the new filesystem partition/boot drive as Bootable. Just select the drive and press “s” and “q” to quit/finished partition. It will look similar like below;

Set it as a standard boot manager

Next, select Label section now to lable your partitioned disks. First is your swap, select the partition with 1GB space and press “C”, Select SWAP – A swap partition from the menu as figure shown below;

and now, select another partition and press “C”, this partition will be a FS – A File System;

set the partition mount point as “/”, figure shown below. It will be the bootable drive for FreeBSD installation.

“Q” to quit partition labeling. Next, select a distributions for your installation. I recommend a light distri, so just select Developer distri. (others distribution packages might need 2nd or 3rd FreeBSD cds)


Next is select commit to start your FreeBSD installtion, and don’t panic when you see….

this

That’s mean installation is about to start….


Figure above shown installation just stated and in process, leave it do the job for about 5-10mins.


Installation DONE! and would you like to configure others stuff? ok.. let me guide you setup simple networking in a LAN.


Select Networking from the configuration menu..


Setup a network with a network Interface card.


configure your gateway, name server and etc..


and yaa.. bring up the network..


and now Exit installation and reboot your machine.. FreeBSD installation DONE!

For more information, check out FreeBSD very usefull and informative manual/handbook here

What to do next? I will blog about it next FreeBSD article!