Webserver configuration

Instructions for configuring Drupal sites on Apache, Lighttpd and nginx.

PHP
PHP 5.2 or higher is recommended.

  • Apache PHP config:

    ./configure \
    --with-apxs2=/usr/local/apache2/bin/apxs \
    --with-mysql=/usr/local/mysql \
    --enable-mbstring \
    --with-gd \
    --with-curl \
    --with-jpeg-dir \
    --with-bz2 \
    --with-zlib \
    --with-pdo-mysql=/usr/local/mysql

    Apache Virtual Host Configuration
    Enable the virtual host config file in /usr/local/apache2/conf/httpd.conf by uncommenting it:

    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf

    Edit /usr/local/apache2/conf/extra/httpd-vhosts.conf and add an entry for your new Drupal install:

    <VirtualHost *:80>
      ServerName www.domain.com
      #ServerAlias *.domain.com
      DocumentRoot /var/websites/projectname/htdocs/drupal-7.17

      <Directory /var/websites/projectname/htdocs/drupal-7.17>
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
      </Directory>

      ErrorLog /var/websites/projectname/logs/error_log
      CustomLog /var/websites/projectname/logs/access_log combined
    </VirtualHost>

  • Lighttpd PHP config:
    ./configure \
    --with-mysql=/usr/local/mysql \
    --enable-mbstring \
    --with-gd \
    --with-curl \
    --with-jpeg-dir \
    --with-bz2 \
    --with-zlib \
    --with-pdo-mysql=/usr/local/mysql

    Lighttpd configuration
    Edit /service/lighttpd/root/sites/sitename.conf:

    var.basedir = "/var/websites/sitename/"
    server.document-root = basedir + "htdocs/drupal-7.17"

    # http://drupal.org/node/43782 - Clean URLs with Lighttpd
    url.rewrite-if-not-file = (
      "^/system/test/(.*)$" => "/index.php?q=system/test/$1",
      "^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2",
      "^\/([^\?]*)\?(.*)$" => "/index.php?q=$1&$2",
      "^\/(.*)$" => "/index.php?q=$1",
    )
    accesslog.filename = basedir + "logs/access_log"

    Add the VirtualHost config file to /service/lighttpd/root/lighttpd.conf:

    $HTTP["host"] == "www.sitename.com" {
      include "sites/sitename.conf"
    }

    http://realize.be/drupal-lighttpd-clean-urls-made-easy

  • nginx configuration

    Filefield nginx Progress

Recent Updates

  • 11 months 1 week ago
  • 11 months 1 week ago
  • 11 months 1 week ago
    php 8.x
  • 11 months 1 week ago
    10.6.7
  • 11 months 2 weeks ago
    Drop Centos 5/6 stuff