25 September 2011

header ('Location: http://www.domain.com/blablabla.php') does not work


One minor problem when creating a website using php, this trivial problem sometimes hinder the work / logic that is more important.

One issue that is trivial: Header ("Location:");

As we all know that the tag header ("Location:"); in php function to send a redirect header or page to another.

At the time of failure, the classic problems that occur are:

21 August 2011

POP3 Error, can not get an email from mail client

And after the nmap / port scanning, port 110 was used as the default POP3 unopened same alias Shorewall closed ... :-P

The solution so just add the Shorewall rules in it, like this:
POP3/ACCEPT net $ FW
POP3/ACCEPT loc $ FW

restarting Shorewall
# Shorewall restart

That't all ;)

12 July 2011

ERROR: Connection dropped by IMAP server.

At the time of testing postfix + squirrelmail error often appear like that, my experience could be due to closed ports, usually port 25. Or often because the spool directory for the user in question has not been made.

Spool directory is usually in:
/var/spool/mail

or at:
/home/vmail/[domain]/[user]

HTH;-)

12 June 2011

Why send an email from the MTA always detected as spam by gmail, yahoo, etc?

For those of you who never make the MTA, whether it's using Postfix, Exim, netmail, qmail, zarafa, zimbra or the other. Maybe dah never ngalamin if sending spam emails are always detected by the receiver, why?

There are tools that can be checked ngebantu we make our mistakes where, due to factors causing our email detected as spam or junk email there are quite a lot, and later komulasi of that requirement would be a score that nentuin email us it will be detected as spam or not.

Okay, a tool for checking it at: http://www.allaboutspam.com/email-server-test/

How to use:

12 May 2011

Install Pidgin 2.7.0 in Ubuntu Lucid Lynx through source

Okay, here's how to install the source (rather than via ppa):

*) Download Pidgin 2.7.0 source from sourceforge (I like usemirror jaist)

*) Extract source pidgin that has been downloaded

*) Add the following repository (if not already there):
deb-src http://archive.ubuntu.com/ubuntu lucid main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ lucid main universe multiverse restricted

*) Open a terminal, type:
apt-get install apt-get build-dep pidgin

*) Configure pidgin:
cd /directory/nyimpen/source/pidgin
./configure
Make
make install

Next create a launcher, could be in the Applications or the Panel ;-)

12 April 2011

Stress Testing ...? Do We Need To...???

Server configuration has been completed, the system / web application has no error, the network confirmed ready, whether it is ready for live production ...?

Wait a minute (do) we also have to estimate how many users will be live using the system / application, we must also estimate how many and how large the data received and sent by the server, was also request from users of the system ... What if the server is runing live was unable aka kuwalahan to receive many requests at one time, or a lot of data transferred (uploaded) to the server at the same time.

Nahhh, to find out, we can test the server and the network to be used as the live production. The term stress testing or benchmarking stress.

What tools do we need ..?

Just use ab, the tools already in the build to be included when you install apache2.

How To ...?

How, we first create a dummy file (if it does not have a file to be used for testing ...
$ Time dd if = /dev/zero of = test.pdf bs = 500000000 count = 1
1 +0 records in
1 +0 records out
500000000 bytes (500 MB) copied, 5.77993 s, 86.5 MB/s

real 0m5.832s
user 0m0.000s
sys 0m1.140s
$ Ls-l
Total 488 288
-Rw-r - r - 1 500 000 000 andri andri 2010-05-07 01:33 test.pdf

Nahhh, already have a file that we want to use to beat up our server, the size of 500 Mb. Time for us to test:

$ ab -n 100 -c 10 -p test.pdf http://localhost/

means we are going to test the server with 100 requests (-n) with 10 connections (-c) the upload file test.pdf (-p) of 500 Mb.

We'll see what ab word:

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done


Server Software: Netscape-Enterprise/6.0
Server Hostname: localhost
Server Port: 80

Document Path: /
Document Length: 309 bytes

Concurrency Level: 4
Time taken for tests: 45.042 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 57000 bytes
Total POSTed: 50000013100
HTML transferred: 30900 bytes
Requests per second: 2.22 [#/sec] (mean)
Time per request: 1801.683 [ms] (mean)
Time per request: 450.421 [ms] (mean, across all concurrent requests)
Transfer rate: 1.24 [Kbytes/sec] received
1084056.23 kb/s sent
1084057.47 kb/s total

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 455 374.5 444 1325
Processing: 443 1347 393.0 1332 2307
Waiting: 1 896 384.3 889 1817
Total: 1325 1802 644.2 1348 3195

Percentage of the requests served within a certain time (ms)
50% 1348
66% 1817
75% 2661
80% 2664
90% 2688
95% 2711
98% 3142
99% 3195
100% 3195 (longest request)

To determine the extent to which powerful server, do to get an error / failed in the output.

And to know the parameters ab more, please visit: http://httpd.apache.org/docs/2.0/programs/ab.html

HTH ;)

12 March 2011

Overcoming a Full Linux Memory

Occasionally, the computer / server we have full memory (RAM) when running multiple processes simultaneously. Memory is full this will cause the performance of your computer / linux server becomes slow or even stop at a certain limit (hank)

To overcome it, we can tell the kernel to clean the cache, dentries and inodes from memory. The trick ...?

*. To clean pagecache
# Echo 1 > /proc/sys/vm/drop_caches

*. To clean inodes and dentries
# Echo 2 > /proc/sys/vm/drop_caches

*. To clean all three (pagecache, inodes and dentries)
# Echo 3 > /proc/sys/vm/drop_caches

To do this periodically, please cron one of the above command (echo 3 I use to clean all three):
# Crontab-e
* * / 2 * * * echo 3> / proc / sys / vm / drop_caches

The above example will clear pagecache, inodes and dentries in memory every 2 hours

HTH
;-)

12 February 2011

How to find out what subdomains are in a domain use the linux command

Subdomain is a separate domain which is a child / child of tld (top level domain it) for example is a subdomain of ndri.info http://a.ndri.info with the subdomain name "a" or www.google.com is a subdomain of google tld . com with the name of the subdomain "www"

The way to find out what subdomains are in a domain / site that I know there are 2 ways. The first way to use the sites dns lookup, the second way is by using linux command dig. Here each way:

1. Using the sites dns lookup

One of the most complete output is http://www.magic-net.nl/dns-lookup.php, just enter the domain address and click the DNS Lookup and results can be enjoyed after the query is completed

2. Using the Linux Command: dig

It's more simple to use tools above, but there are times when someone would prefer a linux command dns lookup tools than the above, especially for the managers of servers that are only dealing with black and white screen (aka console) which can not execute jquery with a text based browser

The way is two steps:

a. See NS (Name Server) which manages the site, with the command:
$ dig domain.com NS

Exp :

$ dig ndri.info NS
; <<>> DiG 9.6.1-P1 <<>> ndri.info NS
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59703
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ndri.info. IN NS

;; ANSWER SECTION:
ndri.info. 85841 IN NS us3.jakhoster.com.
ndri.info. 85841 IN NS us4.jakhoster.com.

;; Query time: 48 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue May 4 03:38:49 2010
;; MSG SIZE rcvd: 76

there we can see that the NS who manages ndri.info is us3.jakhoster.com

b. See the list of existing subdomains to dig axfr
$ dig @[NS] domain.com axfr

Exp :
$ dig @us3.jakhoster.com ndri.info axfr
; <<>> DiG 9.6.1-P1 <<>> @us3.jakhoster.com ndri.info axfr
; (1 server found)
;; global options: +cmd
ndri.info. 86400 IN SOA us3.jakhoster.com. support.jakhoster.com. 2010021002 86400 7200 3600000 86400
ndri.info. 14400 IN MX 0 ndri.info.
ndri.info. 86400 IN NS us3.jakhoster.com.
ndri.info. 86400 IN NS us4.jakhoster.com.
ndri.info. 14400 IN A 74.53.97.75
a.ndri.info. 14400 IN A 74.53.97.75
update.a.ndri.info. 14400 IN A 74.53.97.75
www.update.a.ndri.info. 14400 IN A 74.53.97.75
www.a.ndri.info. 14400 IN A 74.53.97.75
ache.ndri.info. 14400 IN A 74.53.97.75
www.ache.ndri.info. 14400 IN A 74.53.97.75
catatan-a.ndri.info. 14400 IN A 74.53.97.75
www.catatan-a.ndri.info. 14400 IN A 74.53.97.75
contoh.ndri.info. 14400 IN A 74.53.97.75
www.contoh.ndri.info. 14400 IN A 74.53.97.75
dabelyudabelyudabelyu.ndri.info. 14400 IN A 74.53.97.75
www.dabelyudabelyudabelyu.ndri.info. 14400 IN A 74.53.97.75
foto-a.ndri.info. 14400 IN A 74.53.97.75
www.foto-a.ndri.info. 14400 IN A 74.53.97.75
ftp.ndri.info. 14400 IN CNAME ndri.info.
keluarga-a.ndri.info. 14400 IN A 74.53.97.75
www.keluarga-a.ndri.info. 14400 IN A 74.53.97.75
kerjaan-a.ndri.info. 14400 IN A 74.53.97.75
www.kerjaan-a.ndri.info. 14400 IN A 74.53.97.75
localhost.ndri.info. 14400 IN A 127.0.0.1
mail.ndri.info. 14400 IN CNAME ndri.info.
update.ndri.info. 14400 IN A 74.53.97.75
update-a.ndri.info. 14400 IN A 74.53.97.75
www.update-a.ndri.info. 14400 IN A 74.53.97.75
www.ndri.info. 14400 IN CNAME ndri.info.
ndri.info. 86400 IN SOA us3.jakhoster.com. support.jakhoster.com. 2010021002 86400 7200 3600000 86400
;; Query time: 275 msec
;; SERVER: 74.53.97.74#53(74.53.97.74)
;; WHEN: Tue May 4 03:40:17 2010
;; XFR size: 31 records (messages 1, bytes 742)

HTH :)

12 January 2011

How To Know Folder Size in Linux

As we all know that the folder in linux was identified as a given file or directory d flag, after the ls command is given will surely display the default size of a folder that is 4096:

andri@bima:/home/andri/repo-10.04$ ls -l
total 16
-r--r--r-- 1 root root 10 2010-05-02 23:00 Archive-Update-in-Progress-ranah.web.id
drwxr-xr-x 7 root root 4096 2010-04-30 19:47 dists
drwxr-xr-x 6 root root 4096 2010-05-01 02:58 pool
drwxr-xr-x 3 root root 4096 2010-05-02 21:12 project

to see the size of a directory or folder can use the du command, for example:

andri@bima:/home/andri/repo-10.04$ du -s
41173756
andri@bima:/home/andri/repo-10.04$ du -hs
40G
andri@bima:/home/andri/repo-10.04$ du -hs /home/andri/repo-10.04
40G /home/andri/repo-10.04/

That's it :)