====== DokuWiki with Mac OS X and Apache ======
===== Mac OS X client =====
^ [[install:mac_alt|Please follow this link to see as well another page about installing on Mac OS X with darwinports]] ^
Apache and PHP are pre-installed on Mac OS X client, but disabled by default. The following should work for Leopard (10.5.x), Tiger (10.4.x) and Panther (10.3.x) client (if there is no previous version of DokuWiki installed):
- Enable PHP in Apache and Allow Directory Accesses
- Backup httpd.conf:
$ sudo cp /private/etc/apache2/httpd.conf /private/etc/apache2/httpd.conf.bak
- Edit httpd.conf:
$ sudo pico /private/etc/apache2/httpd.conf
- Make the following changes to httpd.conf:
* Delete the # at line 114
CHANGE:
#LoadModule php5_module
TO:
LoadModule php5_module
* Change "Deny" to "Allow" at line 177
CHANGE:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
TO:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
- Start Personal Web Sharing in System Preferences -> Sharing
- [[sb>dokuwiki|Download dokuwiki-yyyy-mm-dd.tgz]] (assuming to ~/Downloads)
- Unpack downloaded file, move to appropriate location, and change ownership:
$ cd ~/Downloads && tar -zxvf dokuwiki-yyyy-mm-dd.tgz
$ mv dokuwiki-yyyy-mm-dd ~/Sites/dokuwiki
$ cd ~/Sites/dokuwiki
$ sudo chown -R www data conf
- Restart Apache:
sudo apachectl graceful
You should now be able to run the installer at [[http://localhost/~your_username/dokuwiki/install.php]]
===== Mac OS X Server =====
For Tiger (10.4.x) and Panther (10.3.x) server:
- Mac OS Server has Apache and PHP pre-installed; they are enabled through the Server Admin application. Enable "php4_module" under Web -> Modules, and start (or restart) and configure the web service.
- [[sb>dokuwiki|Download dokuwiki-yyyy-mm-dd.tgz]] (assuming to ~/Desktop)
- From the command line:
$ cd ~/Desktop && tar -zxvf dokuwiki-yyyy-mm-dd.tgz
$ mv dokuwiki-yyyy-mm-dd ~/Sites/dokuwiki
$ cd ~/Sites/dokuwiki
$ sudo chown -R www data conf
You should now be able to run the installer at [[http://localhost/dokuwiki/install.php]]
===== Notes =====
* The third-party Apache2 package runs as 'nobody', not 'www' -- change your chown command accordingly
* FYI, On Leopard I'm seeing my third party Apache2 running as 'daemon' instead of 'nobody'.
* When editing any config files manually, make sure they are saved with UNIX lineendings (LF) not Mac lineending (CR)
* When clicking on links doesn't work -will not bring you to the requested page- nor does the Login-button, you should supply DokuWiki with a basedir. For this add((or change this line directly in the dokuwiki.php file)) the following line in your local.php((in the conf directory)) file (Mind that the absolute dir from your serveroot is not the root from your computer, but the root from your profile with leading tilde (~).) :
$conf['basedir'] = '/~yourusername/dokuwiki/'; //absolute dir from serveroot - blank for autodetection
* In OSX 10.4, ACL doesn't work properly with the build-in webserver. In the DokuWiki, when entering the UN + PW on the Login page, it responds with "Sorry, username or password was wrong."
* There is a somewhat outdated [[http://the.taoofmac.com/space/HOWTO/Install%20DokuWiki%20on%20Tiger|HOWTO for DokuWiki on Tiger]] available
* it is possible to use [[http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man1/chmod.1.html|filesystem ACLs]] in lieu of the traditional ''chmod'' commands above (the benefit being you don't need to be admin (sudo), and also you retain access to files created by Dokuwiki), as follows (i.e. instead of the chmod commands, run these instead):
$ cd ~/Sites/dokuwiki
$ chmod -R +a "group:www allow read,search,file_inherit,directory_inherit" .
$ chmod -R +a "group:www allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" {conf,data}
$ chmod -R +a "user:$(id -u -n) allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" {conf,data}
----
What about MacPorts? Can anyone offer guidance there? (the MacPorts documentation is sparse on everything, so some help here would be nice)