Hari ini seorang teman menelpon dan bercerita bahwa webmailnya yang menggunakan squirrelmail tidak bisa menampilkan satu pesan dari sang boss. Padahal email tersebut dikirim oleh sang boss untuk beberapa orang. Setiap kali mencoba untuk membuka email itu, yang tampil bukannya pesan dari sang boss tapi hanya halaman kosong.
Saya kemudian mencoba untuk mencari penyebabnya. Awalnya saya mengira penyebabnya adalah format nama file yang tidak biasa. Pesan tersebut memiliki format :
1246937323.M970733P17813V0000000000000803I0008FEF9_0.somedomain.com,S=1317:2,
padahal biasanya format nama file adalah :
1246846105.27436.somedomain.com,S=1207:2,
tapi ternyata tidak juga. karena setelah dibandingkan, pada beberapa penerima formatnya ada yang biasa tapi tidak bisa tampil juga.
Selanjutnya yang bisa jadi penyebab adalah ukuran file yang terlalu besar. Pesan si boss memiliki ukuran file 8,5Mb. Saya lalu mencari-cari di log file untuk menemukan error yang kira-kira ada hubungannya dengan ukuran file yang besar. Di error log apache ada pesan seperti berikut :
Allowed memory size of 33554432 bytes exhausted (tried to allocate 140 bytes)
Agar lebih yakin bahwa pesan error tersebut memang diakibatkan jika membuka email si boss maka saya tail -f error_log lalu mencoba membukan email si boss dari webmail. Ternyata pesan error tersebut muncul lagi.
Mbah google memberi nasihat untuk mengedit php.ini dan mengganti memory_limit dengan angka yang lebih besar. Maka saya ganti menjadi memory_limit = 64M lalu restart apache. Mbah google memang benar, sekarang email dari si boss sudah bisa tampil.
Terima kasih mbah google……
just the other day my friend, a programmer, complained that he couldn’t got captcha work for his new application. he thought that it was the web server that had no gd library. so he asked my other friend, the server’s sysadmin, to install the library. and the sysadmin did so. a few moments later the programmer called again and said that it was still not working.
the sysadmin then asked me to check if other library might be needed to make captcha work on the new web server. so i did the check, all requirements seemed to be there already and captcha should be working. why didn’t it work? i asked uncle google for help and i found this website that provides free scripts to generate captcha. it also has a script to test whether a server is good enough for captcha. so i download the script and put it on the web server and execute it.
and whalaa…. the server’s not ready for captcha.
what could be wrong? then i tried my old trick…. restart apache. and finally it worked. my friend forgot to restart apache. we should always restart apache when there’s a configuration change. btw i think the script is very useful to test whether a web server is ready for captcha or not. we can use it to make sure that everything is ok before blaming the programmer that it’s his code that’s broken
Related articles by Zemanta
I got this somewhere from the internet but don’t remember the url. I translate it into indonesian, here it is :
untuk multiuser login screen, phpmyadmin mendukung 2 jenis otentikasi yaitu cookie dan http. untuk menggunakannya, pertama-tama harus membuat sebuah account/user dengan permission yang terbatas yang gunanya untuk melakukan pemeriksaan otentikasi oleh phpmyadmin.
1. Buat user dengan permission terbatas
anda dapat membuat user tersebut lewat phpmyadmin atau dari console mysql. pada contoh ini user dan password yang digunakan adalah SECURE.
mysql>GRANT USAGE ON mysql.* TO SECURE@localhost IDENTIFIED BY “SECURE”;
mysql>GRANT SELECT (
Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
Execute_priv, Repl_slave_priv, Repl_client_priv
) ON mysql.user TO SECURE@localhost;
mysql>GRANT SELECT ON mysql.db TO SECURE@localhost;
mysql>GRANT SELECT ON mysql.host TO SECURE@localhost;
mysql>GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO SECURE@localhost;
2. Tentukan tipe otentikasi mana yang anda inginkan dan ikuti petunjuk yang sesuai berikut ini :
2a. OTENTIKASI DENGAN COOKIE
buka file config.inc.php dan cari variabel controluser dan controlpass dan sesuaikan seperti berikut ini :
$cfg['blowfish_secret'] = ‘FISHY’;
$cfg['Servers'][$i]['host'] = ‘localhost’; // MySQL hostname
$cfg['Servers'][$i]['port'] = ”; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ”; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['auth_type'] = ‘cookie’; // Authentication method
$cfg['Servers'][$i]['user'] = ”; // MySQL user
$cfg['Servers'][$i]['password'] = ”; // MySQL password
$cfg['Servers'][$i]['controluser'] = ‘SECURE’; // MySQL control user settings
$cfg['Servers'][$i]['controlpass'] = ‘SECURE’;// access to the grant tables
jangan lupa untuk mengosongkan user dan password seperti yang terlihat pada contoh diatas. variabel blowfish_secret dapat anda ganti sesuai keinginan.
bukalah phpmyadmin anda dari browser dan coba login dengan account yang biasanya anda pakai.
2b. OTENTIKASI HTTP
buka file config.inc.php dan cari variabel controluser dan controlpass dan sesuaikan seperti berikut ini :
$cfg['blowfish_secret'] = ‘FISHY’;
$cfg['Servers'][$i]['host'] = ‘localhost’; // MySQL hostname
$cfg['Servers'][$i]['port'] = ”; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ”; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['auth_type'] = ‘HTTP’; // Authentication method
$cfg['Servers'][$i]['user'] = ”; // MySQL user
$cfg['Servers'][$i]['password'] = ”; // MySQL password
$cfg['Servers'][$i]['controluser'] = ‘SECURE’; // MySQL control user settings
$cfg['Servers'][$i]['controlpass'] = ‘SECURE’;// access to the grant tables
jangan lupa untuk mengosongkan user dan password seperti yang terlihat pada contoh diatas. variabel blowfish_secret dapat anda ganti sesuai keinginan.
bukalah phpmyadmin anda dari browser dan coba login dengan account yang biasanya anda pakai.
one of our programmer needs to access microsoft sql server from our php server, so i have to reinstall php to add this support (php-mssql), here’s what i do :
1. download freetds from
ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
2. build and install freetds :
$ tar xzfv freetds-stable.tgz
$ ls
$ cd freetds-0.64
$ ./configure –prefix=/usr/local/freetds –enable-msdblib
$ make
$ su -
$ make install
$make clean
3. build and install php
$ tar xjfv php-5.2.4.tar.bz2
$ cd php-5.2.4
$ ./configure –with-apxs2=/usr/local/apache2/bin/apxs –enable-magic-quotes –with-openssl –with-zlib –with-bz2 –enable-ftp –with-gd –enable-mbstring –with-mysql=/usr/include/mysql –with-mysqli=/usr/bin/mysql_config –with-freetype-dir –with-t1lib –with-jpeg-dir –with-mssql=/usr/local/freetds
$ make
$ su -
$ make install
$ make clean
4. check httpd.conf to make sure php5 module not loaded twice. then restart apache.
1. make sure rpm’s version is not installed
$ rpm -qa | grep postgresql
if installed, remove it
$ rpm -e postgresql-pl postgresql-test postgresql-server
2. download the source
$ wget -b http://ftp9.id.postgresql.org/v8.2.5/postgresql-8.2.5.tar.bz2
3. after download has finished
$ ./configure
$ gmake
$ su
$ gmake install
$ adduser postgres
$ mkdir /usr/local/pgsql/data
$ chown postgres /usr/local/pgsql/data
$ su - postgres
$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
$ /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
$ /usr/local/pgsql/bin/createdb test
$ /usr/local/pgsql/bin/psql test
4. copy start-up script from contrib folder
$ pwd
make sure you are in postgresql-8.2.5 folder then
$ cd contrib/start-scripts/
$ cp linux /etc/rc.d/init.d/postgresql
$ chmod 755 /etc/rc.d/init.d/postgresql
$ chkconfig –add postgresql
$ service postgresql restart