Archive for the 'Apache' Category

MovableType and mod_perl2?

I’ve been able to get MovableType and libapache2-mod-fcgid to play nicely together, and tonight I tried to get MovableType and mod_perl2 to work. Alas, I’m not sure it can happen:

http://codewitch.org/2007/10/mt-and-mod-perl-2.html

I gave up on this and decided to continue using mod-fcgid. It works well enough.

Even more perl notes

Yes I’ve got more:

Does mod_deflate cause problems with memory expansion? I *think* its due to Apache claiming small bits of memory, which would eventually level off. Using GTop, I see the Apache process add about 20kb of memory usage every request. If I turn off compression, it goes away. Yeh - I guess it has to do with how the output streams out of Apache. If the deflate output filter doesn’t know how much data is coming, its going to add a little more, just in case its needed. By turning off (aka disable) output buffering in the perl output handler, the deflate filter knows ahead of time how much memory it will need, and if it needs to allocate some more. I am doing this using the following method:

 
sub handler {
 
    $| = 0;
    my $r = shift;
    my $output;
 
...
 
}

Hmmm, tested that again, the memory still bumps up a little each request. Meh, so I turned off compression, and am now using nginx as a reverse proxy to compress the content:

25013 www-data  15   0  4968 1420  700 S  0.0  0.1   0:00.17 nginx                                                                                             
25544 www-data  15   0 42384  25m  532 S  0.0  2.6   0:00.00 apache2                                                                                           
25545 www-data  18   0 68024  30m 5592 S  0.0  3.2   0:01.88 apache2                                                                                           
25587 www-data  15   0 68480  31m 5592 S  0.0  3.2   0:01.03 apache2

Oh yes, and of course I have varnish setup in front of nginx to cache content too. :-)

Good stuff:
* use strict;
* use warnings;
* Running apache as a single process is helpful for identifying memory leaks with gtop.

Surprise:
Nginx is very efficient. Good.

Another Apache Server




I’m setting up another Apache server to start hosting services based upon software “invented here”. I’ve been working on several projects using Nexista to replace software which, while great, doesn’t mesh well with a lot of what I’ve been working on for the past several years.

When I say “mesh”, I’m basically talking about integration. I like to use the word mesh because that’s how XML and XSL feels to me sometimes, the two just fit together so well. And that’s how I’ve been working. Most of the software I’ve been writing is for internal use, but now that I’ve started to open up our packages, it makes sense to use them as public services as well.

I’ll likely start with Infonomix, an open source project management program, similar to trac. Then follow up with phunkybb, a forum based on punbb.

To get the ball rolling, I’ve created a new virtual server using OpenVZ, named “Marge”. It will be accessed using mod_proxy to route specific requests to the new server from “Homer”, which hosts the packages I currently use, like Wordpress, MediaWiki, and Trac.

AWStats on Debian

Ran into an issue where logrotate makes Apache server logs owned by root. Found a fix here:

http://ubuntuforums.org/showthread.php?t=45879

/var/log/apache2/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 640 root www-data
    sharedscripts
    postrotate
        if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
            /etc/init.d/apache2 reload > /dev/null
        fi
    endscript
}