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

  • 8 months 3 weeks ago
    1.27.2 update
  • 9 months 4 days ago
    Drupal 10/11 config
  • 9 months 6 days ago
  • PHP
    9 months 6 days ago
    PHP 8.3.11 and AlmaLinux
  • 9 months 6 days ago
    New version of Pound