วันอังคารที่ 31 พฤษภาคม พ.ศ. 2554

apache http auth with cgi

If you are using apache http auth with cgi, you have a few more things to do.
You need to enable .htaccess

RewriteEngine On
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]

วันอาทิตย์ที่ 15 พฤษภาคม พ.ศ. 2554

mysql open query log without changing my.cnf and restart

Use mysql client connect to server

#show variables like 'general%';

+------------------+----------------------------+
| Variable_name | Value |
+------------------+----------------------------+
| general_log | OFF |
| general_log_file | /var/run/mysqld/mysqld.log |
+------------------+----------------------------+

This 2 vaiables control mysql query logging.

To turn query log on :
SET GLOBAL general_log_file = '/var/log/mysql/sql-log.log' ;
SET GLOBAL general_log = 1


To turn query log off :
SET GLOBAL general_log = 0 ;
SET GLOBAL general_log_file = '/var/run/mysqld/mysqld.log';

Notice: This is for mysql 5.1 only. For mysql 5.0, those variable is not available. you need editing my.cnf and restart.