0
votes

I'm emulating Ubuntu on my mac, and I use it as a server.

I've installed lighttpd + Drupal and the following configuration section requires a domain name in order to make clean urls to work.

Since I'm using a local server I don't have a domain name and I was wondering how to make it work given the fact the ip of the local machine is usually changing.

thanks

$HTTP["host"] =~ "(^|\.)mywebsite\.com" {
  server.document-root = "/var/www/sites/mywebsite"
  server.errorlog = "/var/log/lighttpd/mywebsite/error.log"
  server.name = "mywebsite.com"
  accesslog.filename = "/var/log/lighttpd/mywebsite/access.log"
  include_shell "./drupal-lua-conf.sh mywebsite.com"

  url.access-deny += ( "~", ".inc", ".engine", ".install", ".info",
       ".module", ".sh", "sql", ".theme",
       ".tpl.php", ".xtmpl", "Entries",
       "Repository", "Root" )


  # "Fix" for Drupal SA-2006-006, requires lighttpd 1.4.13 or above
  # Only serve .php files of the drupal base directory
  $HTTP["url"] =~ "^/.*/.*\.php$" {
      fastcgi.server = ()
      url.access-deny = ("")
  }

  magnet.attract-physical-path-to = ("/etc/lighttpd/drupal-lua-scripts/p-.lua")

}
1

1 Answers

1
votes

You can always use localhost as the hostname. localhost points to 127.0.0.1 which is your local server. Assuming lighttpd is configured to listen on every interface that should work.

Just try http://localhost/ and see what happens.

if you need to configure your site in a subdirectory of your web root dir, something like http://localhost/site1/ and you want to access that from a single domain like site1.localhost you can always add that to the hosts file (/etc/hosts):

127.0.0.1        site1.localhost

And configure lighttpd appropriately.