FAQforge provides answers for frequently asked questions for the Linux-, MAC and Windows operating systems.

How to enable the query log in MySQL

Wednesday, September 30, 2009 - posted by Till

To debug applications which use a mysql database, it comes in handy to enable the query log to get all SQL queries that were sent to the database.  Open the MySQL configuration file (my.cnf)

vi /etc/mysql/my.cnf

and add the line:

log=/var/log/mysql.log

in the [mysql] section of the file. Depending on the Linux distribution that you use, the my.cnf file can be /etc/my.cnf or /etc/mysql/my.cnf.

Afterwards restart mysql to apply the new the configuration:

/etc/init.d/mysql restart

After running a system upgrade on your Ubuntu based ISPConfig 3 server, it might happen that aptitude overwrites some config files from postfix especially the main.cf file. To fix this, download the latest ISPConfig 3 installer, unpack it and run the update.php script. Choose "yes" when the updater asks if the services shall be reconfigured. ISPConfig will replace the configuration files that had been modified by the ubuntu upgrade.

cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xvfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install
php -q update.php

How to add a root SSL certificate in ISPConfig 2

Wednesday, September 23, 2009 - posted by Till

Most SSL authorities (like godaddy or instantssl) send you a root certificate which has to be installed beside the SSL certificate to proove that the SSL cert is signed from a trusted authority. To add such a root SSL certificate in ISPConfig, copy the file to the ssl subfolder of the website and then add this line into the apache directives field of the website in ISPConfig:

SSLCACertificateFile /var/www/www.yourdomain.tld/ssl/ca.txt

The path to the root certificate file has to be changed to match the path on your system.

Install postfix with MySQL support on CentOS 5.3 (64Bit)

Monday, September 21, 2009 - posted by Till

The following article explains the steps to compile postfix MTA with MySQL support on CentOS 5.3 as e.g. needed for ISPConfig 3.

Remove the postfix package from CentOS which does not has MySQL support:

/etc/init.d/postfix stop
rpm -e --nodeps postfix

Download the postfix source RPM and install it:

cd /tmp
wget http://mirror.rackspace.com/CentOS/5.3/os/SRPMS/postfix-2.3.3-2.1.el5_2.src.rpm
rpm -i postfix-2.3.3-2.1.el5_2.src.rpm

Edit the spec file to enable MySQL support.

vi /usr/src/redhat/SPECS/postfix.spec

and change the line:

%define MYSQL 0

to:

%define MYSQL 1

Install a few prerequisites before we build the new postfix RPM package

yum install pcre-devel mysql-devel

Build the postfix RPM with MySQL support:

rpmbuild -ba /usr/src/redhat/SPECS/postfix.spec

and install it.

cd /usr/src/redhat/RPMS/x86_64
rpm -i postfix-2.3.3-2.1.x86_64.rpm

Start postfix and configure it to be started at boot time:

/etc/init.d/postfix start
chkconfig --levels 235 postfix on

The language of the generated webslizer statistics is statically compiled into the webalizer binary. To change the language, webalizer has to be recompiled. In the following example, I will recompile webalizer to change the language to german.

Uninstall webalizer and install the GD library:

apt-get remove webalizer
apt-get install libgd2-xpm-dev

Download the latest webalizer sources and uncompress the tar archive:

cd /tmp
wget http://archive.mgm51.com/mirrors/webalizer-files/webalizer-2.01-10-src.tgz
tar xzf webalizer-2.01-10-src.tgz
cd webalizer-2.01-10

Reconfigure and compile webalizer

./configure --with-language=german
make
make install

Create a symlink so that other applications find the webalizer binary in the common place

ln -s /usr/local/bin/webalizer /usr/bin/webalizer

Cleanup

rm -f /tmp/webalizer-2.01-10-src.tgz
rm -rf /tmp/webalizer-2.01-10

Thanks to planet_fox for this FAQ.

Shutdown Windows XP immediately

Thursday, September 17, 2009 - posted by Till

If you shutdown windows XP with the button in the start menu, it often takes minutes until the computer is finally stopped as Windows runs several tasks before it shuts down the computer. If you need to shutdown the computer immediately, you can use this command:

C:\windows\system32\shutdown.exe -s -t 00

Activating the Keyboard Viewer for Special Characters

Monday, September 14, 2009 - posted by nevico

Use the keyboard viewer if you are looking for special or foreign chars or if you just forgot where to find the backslash e.g.

1.: Choose Apple menu  -> System Preferences and click International

2.: Click Input Menu, then toggle the checkbox next to Keyboard Viewer

3.: Toggle the language whose keyboard layout you want to use

4.: Choose Show Keyboard Viewer from the Input menu (international symbol) on the right side of the menu bar (to the left of the Time)

So you get this... very useful:

Keyboard Viewer

Keyboard Viewer

How to prevent the automatic restart after a Windows update?

Monday, September 14, 2009 - posted by Till

One solution is to stop the windows update service to prevent that Windows XP restarts the computer after an update. The update service will be started again after the next boot.

Click on "Start" > "Run" and enter the command:

net stop wuauserv

pure-ftpd does not show more then 2000 files on Debian and Ubuntu

Friday, September 4, 2009 - posted by admin

The pure-ftp daemon by default has a recursion limit of 2000 files, this prevents the server from showing more then 2000 files when you browse a directory with a FTP client. To expand this Limit to e.g 5000 files, create or edit the file /etc/pure-ftpd/conf/LimitRecursion and add a line "5000 500":

echo "5000 500" > /etc/pure-ftpd/conf/LimitRecursion

and then restart pureftpd:

/etc/init.d/pure-ftpd-mysql restart

How to enable DKIM email signatures in amavisd-new and ISPConfig 3

Thursday, September 3, 2009 - posted by admin

DKIM is a system to verify the sender and integrity of emails. ISPConfig 3 uses amavisd-new as content filter for spam and virus scanning and amavisd-new is also able to sign messages with DKIM. The next steps explain how to configure amavisd-new to sign messages for a domain named "example.com" with DKIM. The steps below should work with any amavisd-new setup even if you do not use ISPConfig.

1) Create the domain key:

mkdir /var/db/dkim/
amavisd genrsa /var/db/dkim/example-foo.key.pem

2) Configure amavisd to use this key for the domain example.com. Edit the amavisd configuration file

vi /etc/amavisd/amavisd.conf

and add the following lines:

$enable_dkim_verification = 1;
$enable_dkim_signing = 1;
dkim_key('example.com', 'foo', '/var/db/dkim/example-foo.key.pem');
@dkim_signature_options_bysender_maps = (
{ '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } );
@mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12
192.168.0.0/16);  # list your internal networks

3) Run the command:

amavisd showkeys

to get the public key that has to be added as TXT record in the DNS server of the example.com DNS server.

4) Thest the setup with the command:

amavisd testkeys

and if it works properly, restart amavisd:

/etc/init.d/amavis restart

Here is a more detailed description in the amavisd-new manual on how to setup DKIM in amavisd-new:

http://www.ijs.si/software/amavisd/amavisd-new-docs.html#dkim