skip to content

Web Server

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:

Benchmark Drupal on Apache v.s. Lighttpd, and Pylons v.s. Spring Framework

I was curious on how some of these frameworks or CMS differ in terms of response time. So I did this very simple test.

My hardware: dual xeon, 3GB RAM, two 7200 RPM SCSI disks.

Software version: Drupal-5.7, mysql-5.0.54, apache-2.2.8, lighttpd-1.4.18-r3, php-5.2.6_rc1-r1, PECL-APC-3.0.6, Gentoo linux kernel 2.6.24-gentoo-r3

Data: the Drupal database was from a production website, with over 200MB in size, about 9000 nodes, 280 taxonomy terms, and 100 users.

On apache, it uses mod_php, with APC enabled.

On lighttpd, it uses fastcgi, with APC enabled.

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:
Syndicate content
Powered by Drupal.