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

Archive for April, 2007

As with most things, turning off SSLv2 in Lighttpd is much easier than in Apache. Toss the following line in your lighttpd.conf and you’re good to go:

ssl.use-sslv2 = "disable"

Comments No Comments »

Wordpress uses .htaccess files to process its permalinks structure, but Lighttpd won’t obey .htaccess files (yet). So, instead of banging your head against the wall, just use something like the following:

server.error-handler-404 = "/index.php?error=404"

For example, the virtual host for this very website is:

$HTTP["host"] =~ "rackerhacker\\.com" {
        server.document-root = basedir+"rackerhacker.com/"
        server.error-handler-404 = "/index.php?error=404"
}

Comments No Comments »

I’ve heard a lot of people are interested in something like this, so I decided to create it. I didn’t try to make it look confusing, it just came out that way.

Plesk Database Schematic
plesk-db-diagram.pdf [99KB]

Comments No Comments »

It seems like lighttpd and Tomcat are at the forefront of what is ‘hot’ these days. If you don’t need the completeness of Apache on your server, you can use lighttpd to proxy to Tomcat, and it’s pretty simple. This how-to will show you how to install lighttpd, Tomcat, and the Java JRE. Once they’re installed it will also show you how to get lighttpd to use mod_proxy to connect to your Tomcat installation.

First, some downloading has to be done. Grab the latest lighttpd RPM from rpmfind.net for your distribution. You will also need to pick up the latest version of Tomcat and the Java JRE.

Once all three of those are on the server, get them installed:

# rpm -Uvh lighttpd-1.3.16-1.2.el4.rf.i386.rpm
# tar xvzf apache-tomcat-6.0.10.tar.gz
# mv apache-tomcat-6.0.10 /usr/local/
# chmod +x jre-6u1-linux-i586.bin
# ./jre-6u1-linux-i586.bin
# mv jre1.6.0_01 /usr/local/

Before you can do much else, you will need to set up your JAVA_HOME and add JAVA_HOME/bin to your path. Open up /etc/profile and add the following before the export statement:

JAVA_HOME="/usr/local/jre1.6.0_01/"
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH

To make this change actually take effect, you will need to log out and become root again. Now, check that your JAVA_HOME is set:

# echo $JAVA_HOME
/usr/local/jre1.6.0_01/

If the JAVA_HOME is not set up, check your /etc/profile again. If it’s set up, try starting Tomcat - there’s no need to set the $CATALINA_HOME, because Tomcat can figure it out on its own:

# /usr/local/apache-tomcat-6.0.10/bin/startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-6.0.10
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.10
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.10/temp
Using JRE_HOME: /usr/local/jre1.6.0_01/

Try to connect to the server now on port 8080 and you should see a Tomcat default page. Now, go add a manager user to the $CATALINA_HOME/conf/tomcat-users.xml:

<role rolename="manager"/>
<user username="tomcat" password="password" roles="manager"/>

Restart Tomcat for the changes to take effect:

# /usr/local/apache-tomcat-6.0.10/bin/startup.sh
# /usr/local/apache-tomcat-6.0.10/bin/shutdown.sh

Tomcat is ready to go, so it’s time to configure lighttpd. Open the /etc/lighttpd/lighttpd.conf and activate mod_proxy by uncommenting it:

server.modules = (
# "mod_rewrite",
# "mod_redirect",
# "mod_alias",
"mod_access",
# "mod_cml",
# "mod_trigger_b4_dl",
# "mod_auth",
# "mod_status",
# "mod_setenv",
# "mod_fastcgi",
"mod_proxy",
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
# "mod_cgi",
# "mod_compress",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
"mod_accesslog" )

Drop to the bottom of the configuration file and add something like this, replacing your information as necessary:

$HTTP["host"] =~ “10.10.10.56″ {
proxy.server = (
“” => (
“tomcat” => (
“host” => “127.0.0.1″,
“port” => 8080,
“fix-redirects” => 1
)
)
)
}

Replace the IP address with a hostname or the correct IP for your server. This proxy directive makes lighttpd connect to Tomcat on the localhost on port 8080 whenever a request comes in on port 80 to lighttpd on the IP 10.10.10.56. Start lighttpd now and try it yourself!

# /etc/init.d/lighttpd start

Comments No Comments »

This is tremendously aggravating. I find that this blog mysteriously changes back to the default Wordpress theme without warning at completely random times. After turning on lots of logging, I found that the GoogleBot and regular visitors seemed to be causing it, but they caused it when they made completely normal requests from the site.

After getting flustered, I realized a dirty hack was in order. I made a new theme folder called ‘default-original’ and moved the contents of the default theme into it. After that, I copied the contents of my desired theme folder into the default folder. After waiting a few hours, the magic happened and the theme was reset. But alas - the default theme is now my desired theme.

Dirty hacks sometimes work the best. :-)

Comments 1 Comment »

To disable reverse lookups in qmail with Plesk, simply add -Rt0 to the server_args line in /etc/xinetd.d/smtp_psa


service smtp
{
socket_type = stream
protocol = tcp
wait = no
disable = no
user = root
instances = UNLIMITED
server = /var/qmail/bin/tcp-env
server_args = -Rt0 /usr/sbin/rblsmtpd -r sbl-xbl.spamhaus.org /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
}

Once that’s been saved, simply restart xinetd:

# /etc/init.d/xinetd restart

WATCH OUT! This change will be overwritten if you change certain mail settings in Plesk, like MAPS protection.

Comments 2 Comments »