Deploying Drupal on NetBSD

From NetBSD Wiki

Jump to: navigation, search

Contents

Prelude

We will use Lighttpd with Fastcgi as a webserver and PostgreSQL as a database backend.

The webserver

Please read the following article: Lighttpd_on_NetBSD

The database backend

Throught the guide we will use PostgreSQL as the SQL backend. PostgreSQL is an advanced, full featured open source SQL server. If you don't know how to install it or want to know the NetBSD specific details, read the following article: How to install a PostgreSQL Server

You can also use MySQL, but PostgreSQL is recommended or at least MySQL won't be covered now. Read How to install a MySQL Server if you need more information.

Clean URLs with Lighttpd

Use the following rewrite rules to enable clean urls with Drupal:

# Clean URL
server.modules += ( "mod_rewrite" )

url.rewrite-final = (
  # Clean URL test for 4.6
  "^/system/test/(.*)$" => "/index.php?q=system/test/$1",

  # Clean URL test for 4.7
  "^/system/test-clean-url/(.*)$" => "/index.php?q=system/test-clean-url/$1",

  # feed alias
  "/rss.xml$" => "/index.php?q=rss.xml",

  # Search
  "^/search/(.*)$" => "/index.php?q=search/$1",

  # More than one argument
  "^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2",

  # No arguments
  "^/([^.?]*)$" => "/index.php?q=$1",

  # Exempt .html suffixes. Uncomment this if you have your path aliases end in .html
  #"^/([^.?]*\.html)$" => "/index.php?q=$1"
)

Error handler

# Handler for 404
server.error-handler-404  = "/index.php"
Personal tools