Web Server

Apache Performance Tuning

http://www.devside.net/articles/apache-performance-tuning is a good article on this topic.

In a nutshell, here are things you can do to reduce memory foot print:

  1. Review the list of loaded modules, and remove the ones that you don't need or use
  2. Change mpm_prefork to mpm_worker
  3. Limit MaxClients in mpm config.

Lighttpd Secure Configuration

Reference:

Hardening Apache

First, please check the Apache website for

http://xianshield.org/guides/apache2.0guide.html has some nice tips on how to harden your apache server. Especially, check your httpd.conf and make sure the configurations are fine.

Setup Ruby on Rails behind Apache

Here are some of the ways to run Ruby on Rails behind Apache.

Apache + mod_fcgid

Reference Howto Setup Apache With FastCGI And Ruby Bindings.

Apache mod_fcgid

Make sure mod_fcgid is available, if not, install it
# emerge -pv www-apache/mod_fcgid

Ruby fcgi

I was not able to install it via gem. See error below:

Configure Drupal-6 on Lighttpd

This is what I did:

Setup cgi-bin Access on Lighttpd

Turn on mod_alias and mod_cgi

To setup cgi-bin access, you have to enable both the mod_alias and mod_cgi in /etc/lighttpd/lighttpd.conf:

server.modules += ( "mod_alias" )

include "mod_cgi.conf"

Setup cgi-bin access in localhost

Lighttpd installation came with a mod_cgi.conf in /etc/lighttpd. Check that file to make sure that it has:

Install and Configure lighttpd + PHP on Gentoo

Install lighttpd and php

  1. Read http://gentoo-wiki.com/HOWTO_Lighttpd and decide which USE flags you will need. Write those flags into /etc/portage/package.use. Since I plan to use fastcgi and php, I do have at least these two flags set.
  2. Check php installation. If php was installed but cgi USE flag was off, you have to reinstall php with "USE=cgi".
  3. Now install lighttpd:
    # emerge -v lighttpd
  4. Among the few opcode cache for php, xcache is quite stable on lighttpd. So install that: