Home » Posts tagged "Apache"

Private Wiki – DokuWiki on Lighttpd

I had planned on setting up a private Wiki to use as a personal clipboard collection of useful snippets for some time now but never got around to it. This week I decided it was time to get it done and so I started searching for Wiki software. I ended up trying MediaWiki but ran into installation issues due to PHP’s session.save_handler not being set. After changing it I ran into more issues and with MediaWiki unable to store session data I couldn’t proceed. I’m not sure why MediaWiki requires this setting though as I run several WordPress websites and some other PHP code as well and they’re not having this issue.

Moving on I found out about DokuWiki which is really easy to install! Simply download the package, extract it and you’re done! It doesn’t require special database software such as MySQL – it stores pages on disk. Zero hassle and easy to use as well!

Since I’m not using Apache I can’t use .htaccess files. DokuWiki has a couple of folders which should not be exposed to the outside world. For Lighttpd my configuration looks like this:

$HTTP["host"] =~ "^wiki.example.com$" {
    server.document-root = "/home/example/wiki.example.com/httpdocs"
    # deny access completely to these
    $HTTP["url"] =~ "/(\.|_)ht" { url.access-deny = ( "" ) }
    $HTTP["url"] =~ "^" + "/(bin|data|inc|conf)/"  { url.access-deny = ( "" ) }
}

And you’re all set!

Serving files with Apache on Windows from a network drive

After I installed Zend Server CE today I had to configure Apache to serve files from a shared network drive. Although these have been given a drive name serving files from it with Apache fails to work.

By default Apache under Windows (or generally any service) is being executed as a local user. This user doesn’t have network rights, and normally shouldn’t have any. But in my case it should. So to get this all working I opened the Windows administration tool for services and modified the Apache service to be run as some other user, in my case DOMAIN\username.

After having done that I configured my Apache configuration to serve files from a shared network drive. To my surprise it still didn’t work and my path was correct… For Windows that is. Windows use the backward slash, for example, \\MYSERVER\Projects\example.com. But for this to work with Apache you have to substitute the backward slashes with forward slashes, like this: //MYSERVER/Projects/example.com.

If you do this all should be well and you can serve files from your network through your locally installed Apache.