Mark Fowler ([info]2shortplanks) wrote,
@ 2006-10-26 22:57:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Current location:My House, Walthamstow, London, UK
Entry tags:dokuwiki, macosx, php, wiki

Getting Organised: A Local Wiki
In a burst of activity tonight I finally got round to one of the things I'd been meaning to do for months; Installing a wiki on my computer, which I'm planning to use to organise all my notes and random bits of electronic information in the same way that I use scraps of paper in a filing cabinet in the real world.

I asked around what wiki I should install. I've used mediawiki in the past, but find it over-bloated for my own, personal, needs. It also relies on mysql which is a pain to install, and even more of a pain to keep secure (I really wanted something that would run out of my home directory, so if my laptop got stolen all my data would be encrypted thanks to the wonders of FileVault.)

I've tried kwiki in the past. I found the code base terrible to work with, and despite the fact that I'm not planning to hack or extend my personal wiki that's left a bad enough taste in my mouth to ignore the whole thing.

tiddlywiki was suggested, but I'm not sure if my browser will fall over under the weight of the document if I start putting tons and tons of data into it (tiddly wiki is just an html page and javascript running entirely in the web browser.)

In the end I've decided to try out dokuwiki for a bit. I suspect, like all software, I'll find that it sucks after a few weeks.



Getting Web Pages in My Home Dir To Work

To turn on the webserver you need to click the ticky box next to "Personal Web Sharing" in the "Services" tab of the "Sharing" part of System Preferences.

I couldn't access files in ~/Sites from http://127.0.0.1/~mark/ until I made my home directory world readable. Apache complained by giving me a 403 Forbidden error and shoving the following into my error-log.

   [Thu Oct 26 21:31:16 2006] [error] [client 127.0.0.1] (13)Permission denied: access to /~mark/index.html failed because search permissions are missing on a component of the path


(Note, the error log is located at /var/log/httpd/error-log)

The command to change my home directory's permissions is:

  chmod 755 ~


I think I've got odd permissions because I use FileVault. Go figure.

Getting PHP to work

In order to enable php on the apache that ships with Mac OS X you simply have to uncomment a couple of lines in the apache config, which is located at "/etc/httpd/httpd.conf"

  LoadModule php4_module        libexec/httpd/libphp4.so
  AddModule mod_php4.c


This will (via more config options that are automatically enabled) to serve .php files as php. You'll need Stop and Start websharing for this to take effect.

Installing Dokuwiki

I Downloaded Dokuwiki from here and untarballed it with

  gunzip -c dokuwiki-rc2006-10-19.tgz | tar -xvf -


(And from this you can tell I've spent too much time on systems that don't have a tar that can understand -z installed on them, right?)

I shoved it in ~/Sites/wiki:

mv dokuwiki-rc2006-10-19 ~/Sites/wiki

I then fixed up the permissions

  cd ~/Sites/wiki
  sudo chown -r mark.www conf data
  chmod -R g+w conf data


To be honest, this gave me the chills, since what I'm doing here is saying that the webserver has the right to write files into directories that it'll execute code from, which raises an attack that manages to write to random files to an attack that can run arbitrary code. Oh well, I guess I'll have to suck it up.

I then pointed my web browser at http://127.0.0.1/wiki/install.php and ran the install script. I chose an open wiki, because of what I'm about to do next...

Limitting Access

I don't want anyone else on the network to be able to access my private wiki, but the way apache is set up at the moment it'll serve all files to anyone, no matter which computer you're on. We need to put some access controls in. The wiki has some of it's own, but I'm not sure I trust them, and I don't want to have to log in on my own computer. I'm going to put a block in at the apache level its self.

The way you'd normally do this is with a .htaccess file, but these aren't enabled by default on Mac OS X. The easiest thing to do is edit (as root) the /etc/httpd/users/mark.conf file, and append this section to the end of the file:

  <Directory "/Users/mark/Sites/wiki">
      Order allow,deny
      Allow from 127.0.0.1
      Deny from all
  </directory>


This means you can only access these pages from the local machine. Stop and Start apache from System Preferences to have this take effect.




(9 comments) - (Post a new comment)


[info]mstevens
2006-10-27 07:05 pm UTC (link)
I quite like moinmoin.

(Reply to this)

If you do decide to look around some more
(Anonymous)
2006-10-27 09:24 pm UTC (link)
If you want to look at other wikis, you might consider pmwiki: flat-file structure, very active user/developer community.

Meanwhile, thanks for sharing you setup steps.

(Reply to this)

Problems installing dokuwiki
(Anonymous)
2007-11-12 06:38 am UTC (link)
I am trying to install dokuwiki on my PowerBook G4 15" - tiger 10.4.X

download : dokuwiki-2007-06-26b.tgz
I followed all the steps ...
Problem :
sudo chown -R myname.www conf data
chown: separation of user and group with a period is deprecated
chmod -R g+w conf data

tried 1)

http://localhost/dokuwiki/install.php
The requested URL /dokuwiki/install.php was not found on this server.

2) http://localhost/~myname/dokuwiki/

You don't have permission to access /~myname/dokuwiki/install.php on this server.

This is my third attempt to install this wiki ...can you guide me to fix this.


(Reply to this) (Thread)


[info]racheloriba
2008-07-17 10:25 am UTC (link)
This is regarding my attempt to install KleanSweep into my Eee-PC. From what I read, this programs act like Disk Clean Up program in that Windows XP.

(Reply to this) (Parent)

Line from error log
(Anonymous)
2007-11-12 06:52 am UTC (link)
[Sun Nov 11 22:25:12 2007] [error] [client 127.0.0.1] File does not exist: /Library/WebServer/Documents/dokuwiki/install.php
[Sun Nov 11 22:25:18 2007] [error] [client 127.0.0.1] File does not exist: /Library/WebServer/Documents/dokuwiki/
[Sun Nov 11 22:25:33 2007] [error] [client 127.0.0.1] File does not exist: /Library/WebServer/Documents/dokuwiki/
[Sun Nov 11 22:25:44 2007] [error] [client 127.0.0.1] client denied by server configuration: /Users/myname/Sites/dokuwiki
[Sun Nov 11 22:34:47 2007] [error] [client 127.0.0.1] File does not exist: /Library/WebServer/Documents/dokuwiki/
[Sun Nov 11 22:34:58 2007] [error] [client 127.0.0.1] File does not exist: /Library/WebServer/Documents/dokuwiki/install.php
[Sun Nov 11 22:36:14 2007] [error] [client 127.0.0.1] client denied by server configuration: /Users/myname/Sites/dokuwiki/install.php

(Reply to this)

Idetrorce
(Anonymous)
2007-12-15 02:11 pm UTC (link)
very interesting, but I don't agree with you
Idetrorce

(Reply to this)

Hello all I'm new here !
(Anonymous)
2008-03-17 09:35 am UTC (link)
Just wanted to say Hello to everyone.
Much to read and learn here, I'm sure I will enjoy !

(Reply to this)

NYIP monitoring, listing
(Anonymous)
2008-06-16 03:26 pm UTC (link)

http://besthyiprating.com Monitoring


























































(Reply to this)

stir in truth
(Anonymous)
2008-08-26 10:06 pm UTC (link)
determination about beat

(Reply to this)


(9 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…