Have you tried MySQLTuner yet? It's free and it makes optimizing your MySQL server easier than ever!

Archive for July, 2007

These two commands will enable SpamAssassin for all users on a Plesk 8 server:

# mysql -u admin -p`cat /etc/psa/.psa.shadow` psa
mysql> update mail set spamfilter = 'true' where postbox = 'true';
# /usr/local/psa/admin/bin/mchk --with-spam

Thanks to Sean R. for this one!

Comments No Comments »

Add to /etc/make.conf:

WITHOUT_X11=yes
USE_NONDEFAULT_X11BASE=yes

Comments No Comments »

With portinstall:

# portinstall lighttpd fcgi php5

Without portinstall:

# make -C /usr/ports/www/lighttpd all install clean
# make -C /usr/ports/www/fcgi all install clean
# make -C /usr/ports/lang/php5 all install clean

Add lighttpd_enable="YES" to /etc/rc.conf, and uncomment the usual items in /usr/local/etc/lighttpd.conf to enable fastcgi.

Comments No Comments »

It can be best to upgrade FreeBSD in an offline state, but if you do it online, you can do it like this:

# csup -g -L 2 -h cvsup5.us.freebsd.org /usr/share/examples/cvsup/standard-supfile
# cd /usr/src
# make buildworld
# make buildkernel
# make installkernel
# make installworld
# shutdown -r now

Comments No Comments »

Making Java keystores at the same time as you create a CSR and key is pretty easy, but if you have a pre-made private key that you want to throw into a keystore, it can be difficult. However, follow these steps and you’ll ber done quickly!

Save the new certificate to server.crt and the new key to server.key. If intermediate certificates are necessary, then place all of the certificates into a file called cacert.crt. Now, you will have to make a PKCS #12 file:

openssl pkcs12 -export -inkey server.key -in server.crt -name tomcat-domain.com -certfile cacert.crt -out domain.com.p12

To perform the rest of the work, you will need a copy of the KeyTool GUI. In the GUI, make a new keystore in JKS format. Import the PKCS #12 key pair, and save the keystore as a JKS. Upload the keystore to the server and then configure the keystore within Tomcat/JBoss.

Comments No Comments »

If you have the need to forcefully delete everything in the qmail queue, simply run this shell script (thanks to Florian on this one):

#!/bin/sh
# remove everything - STOP QMAIL FIRST!
/sbin/service qmail stop
for i in bounce info intd local mess remote todo; do
find /var/qmail/queue/$i -type f -exec rm {} \;
done
/sbin/service qmail start

Comments No Comments »

If you find yourself stuck with over 30,000 files in a directory (text files in this example), packing them into a tar file can be tricky. You can get around it with this:

find . -name '*.txt' -print >/tmp/test.manifest
tar -cvzf textfiles.tar.gz --files-from /tmp/test.manifest
find . -name '*.txt' | xargs rm -v

Comments No Comments »

If you want to make a quick bookmark that will automatically log yourself into Plesk, make this bookmark:

https://yourserver.com:8443/login_up.php3?login_name=admin&passwd=yourpassword

Comments 1 Comment »

Enabling submission port support for Postfix is really easy. To have postfix listen on both 25 and 587, be sure that the line starting with submission is uncommented in /etc/postfix/main.cf:

smtp      inet  n       -       n       -       -       smtpd
submission inet n      -       n       -       -       smtpd

Comments No Comments »

Sometimes servers just have the weirdest SSL problems ever. In some of these situations, the entropy has been drained. Entropy is the measure of the random numbers available from /dev/urandom, and if you run out, you can’t make SSL connections. To check the status of your server’s entropy, just run the following:

# cat /proc/sys/kernel/random/entropy_avail

If it returns anything less than 100-200, you have a problem. Try installing rng-tools, or generating I/O, like large find operations. Linux normally uses keyboard and mouse input to generate entropy on systems without random number generators, and this isn’t very handy for dedicated servers.

Comments No Comments »