Tuesday, July 15, 2014

Masalah-masalah Webmail Server

Ada keluhan tentang tidak dapat diaksesnya webmail menggunakan web browser. Nah, langkah pertama yang harus dilakukan adalah melihat status service httpd di server. Untuk itu coba masuk ke console lewat PuTTY. Cek apakah service httpd masih berjalan atau tidak. Untuk itu jalankan perintah baris sbb :

# /etc/init.d/httpd status
httpd dead but subsys locked


Kelihatannya layanan httpd-nya sedang mati, untuk itu coba dijalankan ulang layanan httpd tersebut. Jalankan perintah baris bb:

# /etc/init.d/httpd start
Starting httpd: [Tue Jul 15 13:06:02 2014] [warn] The ScriptAlias directive in /etc/httpd/conf/httpd.conf at line 575 will probably never match because it overlaps an earlier ScriptAlias.
[Tue Jul 15 13:06:02 2014] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 848 will probably never match because it overlaps an earlier Alias.
                                                           [  OK  ]


Karena tetep tidak bisa running atau diakses dari web browser, jalan terakhir adalah melakuan reboot. Sambil di-reboot, sebaiknya lakukan ping ke server webmail ini secara terus menerus untuk menantau status koneksinya.

# reboot
Broadcast message from root (pts/0) (Tue Jul 15 13:08:25 2014):
The system is going down for reboot NOW!


Jika webmail sedang normal, tampilan status httpdnya seperti di bawah ini:

# /etc/init.d/httpd status
httpd (pid  3711) is running...


Bandingkan jika webmail sedang tidak normal :

# /etc/init.d/httpd status
httpd dead but subsys locked


Jika server webmail sedang down, pesan atau email tetep bisa masuk ke sistem karena ditopang sistem mirror, yaitu di server webmail2. Webmail2 diletakkan jauh dari webmail1, yaitu dititipkan di sebuah Data Center milik ISP.

Selain pengecekan dengan cara di atas, pengecekan juga bisa dilakukan dengan perintah ps

# ps -aux | grep http
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root      3711  0.0  0.0  28084 10620 ?        Ss   13:11   0:00 /usr/sbin/httpd
apache    3807  3.7  0.7 143000 123036 ?       S    13:11   1:32 /usr/sbin/httpd
apache    3808  3.5  0.7 144556 124196 ?       S    13:11   1:27 /usr/sbin/httpd
apache    3809  2.9  0.5 105640 85656 ?        S    13:11   1:10 /usr/sbin/httpd
apache    3810  3.3  0.5 103552 83580 ?        S    13:11   1:22 /usr/sbin/httpd
apache    3812  1.1  0.3  70144 50136 ?        S    13:11   0:28 /usr/sbin/httpd
apache    3813  2.7  0.4  92512 72116 ?        S    13:11   1:05 /usr/sbin/httpd
apache    3814  3.4  0.5 118772 98080 ?        S    13:11   1:24 /usr/sbin/httpd
apache    3815  3.8  0.7 152080 131756 ?       R    13:11   1:32 /usr/sbin/httpd
apache    3829  4.0  0.8 169600 149128 ?       S    13:11   1:37 /usr/sbin/httpd
apache    5028  3.4  0.6 120416 99836 ?        S    13:11   1:23 /usr/sbin/httpd
apache    5323  3.3  0.5 119312 98788 ?        S    13:12   1:19 /usr/sbin/httpd
apache    5336  2.6  0.3  82444 61948 ?        S    13:12   1:01 /usr/sbin/httpd
apache    5337  3.0  0.7 146912 126488 ?       S    13:12   1:13 /usr/sbin/httpd
apache    5422  4.5  0.8 167040 146652 ?       S    13:12   1:46 /usr/sbin/httpd
apache    5692  2.5  0.4 100476 80424 ?        S    13:13   0:59 /usr/sbin/httpd
apache    5700  2.4  0.4 100116 79740 ?        S    13:13   0:56 /usr/sbin/httpd
apache    5714  2.5  0.4  97716 77280 ?        S    13:13   0:59 /usr/sbin/httpd
apache    5716  1.6  0.7 139128 119004 ?       S    13:13   0:38 /usr/sbin/httpd
apache    5728  2.4  0.6 131888 111472 ?       S    13:13   0:57 /usr/sbin/httpd
apache    5730  2.5  0.4  97352 76960 ?        S    13:13   0:59 /usr/sbin/httpd
apache   13425  2.3  0.4  93568 72912 ?        S    13:46   0:08 /usr/sbin/httpd
root     14881  0.0  0.0   5144   716 pts/1    S+   13:52   0:00 grep http


Gak bisa logi ke webmail. Error Message :

Error connecting to IMAP Server: localhost
111 : Connection refused

Penyebab : HDD hampir penuh,  dovecot down.

Tindakan : restart dovecot nya

# service dovecot restartStopping Dovecot Imap:                                     [FAILED]
Starting Dovecot Imap:                                     [  OK  ]

Gak bisa kirim email

ERROR: Connection dropped by IMAP server.
Query: CAPABILITY


# service dovecot restart
Stopping Dovecot Imap:                                     [  OK  ]
Starting Dovecot Imap:                                     [  OK  ]


Gak bisa login ke webmail, tidak ada tampilan login form sama sekali
# service dovecot status
dovecot (pid  14136) is running...
 

# service httpd status
httpd dead but subsys locked


# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: [Wed Feb 11 08:25:57 2015] [warn] The ScriptAlias directive in /etc/httpd/conf/httpd.conf at line 575 will probably never match because it overlaps an earlier ScriptAlias.
[Wed Feb 11 08:25:57 2015] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 848 will probably never match because it overlaps an earlier Alias.
                                                           [  OK  ]

Setelah di-debug dan di-investigasi, masalahnya:

1. Meski proses httpd tidak berjalan, tetapi di memori sepertinya masih "menggantung". Untuk mengecek silahkan jalankan perintah berikut (kondisi httpd tidak bisa di-restart):

# ps awux | grep httpd

Hasilnya: tidak ada proses httpd di process table.Kemudian jalankan perintah berikut:

# ipcs -s | grep apache

Maka akan terlihat bahwa process apache masih ada menggantung di memory.Perintah "ipcs" adalah sebuah perintah untuk melihat process yang masih berjalan di memori

2. Proses apache yang sudah tidak ada di process table, tetapi masih ada di memori sepertinya disebabkan oleh beban apache sendiri yang sangat tinggi (mungkin fluktuatif saat pagi) dan akhirnya mati dan hilang dari process table sehingga port 80/443 tidak bisa dibuka, padahal di memori masih ada process apache yang menggantung.

Solusinya:

Meng-kill/menghilangkan process apache dari memori dengan perintah berikut:

# ipcs -s | grep apache | awk '{print $2;}' | while read -r line; do ipcrm sem "$line"; done

Mohon diperhatikan bahwa perintah tersebut hanya boleh dieksekusi saat httpd tidak bisa di-restart.

Ini juga menjawab, kenapa setelah server di-reboot biasanya normal kembali. Ini karena setelah server di-reboot, semua process table, process di memori akan ikut clear.


Tambahan (belum dicoba)
# killall -9 httpd

No comments:

Post a Comment