Serve Your iCal Calendars Using WebDAV
Pages: 1, 2
3. Set Up Directories.
First, you need to set up the realm of WebDAV documents. Based on what we put in the configuration file, this will be in a subdirectory of the document root called /dav. So go to your server's document root (it's usually /Library/WebServer/Documents) and create a new directory called dav. I chose that name because I'll remember later what it's for.
Set the permissions and ownership of this directory so that the Web server can write to it. Do this by changing the group owner to www, which the Web server belongs to:
sudo chgrp www /Library/WebServer/Documents/dav
sudo chmod 775 /Library/WebServer/Documents/dav
Next, you need to make a place for the WebDAV lock database file. For lack of a better place, I created /usr/share/httpd/conf. Again, set the permissions so the server can write files here:
sudo chgrp www /usr/share/httpd/conf
sudo chmod 775 /usr/share/httpd/conf
4. Security Measures
Apache needs to know if the iCal trying to update the calendar is legit. So we have to create a new user and password. Don't use an existing user's name and password. A malicious hacker sniffing your communications can grab that username and use it to sneak inside your system. The username we will create will be limited to WebDAV files only, which will be useless to a would-be intruder.
First, create a password file in /Library/WebServer with this command:
htpasswd -c /Library/WebServer/.basic_pw webdav
You'll be prompted for a password. Invent something secure and save it someplace safe. Make the password unique (don't use one that you use elsewhere) because of the basic authentication risk I mentioned earlier. This password, and the user webdav will be the two parameters you give to iCal to connect to your server.
5. Restart the Server.
You could reboot the machine, but it's more elegant just to give the
server a kick in the rear with the kill command. Don't worry, we
aren't going really kill it. The -HUP option tells it to restart
itself and read its configuration file again. Find the process ID
number (PID) like this:
ps -ax | grep httpd
There will be several httpd processes running, but you only have to
interrupt the first one, which is the master for all the rest. The
command is:
sudo kill -HUP 1234
Where 1234 is the PID of the first httpd process.
6. Publish Your Calendar.
|
Related Reading
Mac OS X for Unix Geeks |
You can close the terminal window now, and return to the cozy graphical interface of iCal. Select the calendar you want to publish and then hit the menu command Calendar -> publish... The window that pops up will give you two options: publish on .Mac or on a Web server. Being a maverick, you will click on the second, which expands the window with more options.
For the URL, put in the full path to the calendar file on the server. The name of the file may not be exactly what you typed in for the calendar. If there are spaces, for example, they will be replaced with the number 32, which is the space character's position in the ASCII character set. You can see ahead of time what the name will be by exporting the database to a file and reading the filename.
For username, put in "webdav". The password you created back in step 4 goes in the next field. And that's it!
You can create as many calendars as you want. I have two: http://www.ravelgrane.com/dav/Home.ics and http://www.ravelgrane.com/dav/Work.ics.
Test it out. You can subscribe to your own calendars, though you may
think you're seeing double. If you have problems, check the Web
server's error log in /var/log/httpd/error_log. When you're done,
you'll be able to tell your friends and associates how to subscribe to
your calendars and feel the respect wash over you.
Happy hacking!
Erik T. Ray is a software wrangler and XML guru for O'Reilly Media.
Return to the Mac DevCenter.
-
Problems with 10.4.8
2006-10-03 02:10:34 colymore [View]
-
updated version...?
2006-01-30 00:43:25 liamstask [View]
-
updated version...?
2006-03-10 01:56:06 Damon_Allen_Davison [View]
-
Worked like a charm
2004-11-17 09:45:09 kevin.allen@mindspring.com [View]
-
I can't even start HELP
2004-06-22 06:42:31 mozart11 [View]
-
I can't even start HELP
2004-06-24 20:21:16 bradpuett [View]
-
ARGH! It just won't work
2004-01-04 19:35:27 anonymous2 [View]
-
ARGH! It just won't work
2004-01-24 07:34:16 shoaiby [View]
-
./configure problem
2003-10-31 05:12:55 cpbjr [View]
-
./configure problem
2006-04-30 08:15:14 sweavo [View]
-
Subscribe without authentication
2003-10-11 18:47:41 anonymous2 [View]
-
make: Command not found
2003-09-14 06:55:17 anonymous2 [View]
-
Can't publish to user Sites folder
2003-06-21 15:57:45 anonymous2 [View]
-
./configure issues
2003-06-16 08:31:48 anonymous2 [View]
-
./configure issues
2003-07-23 07:27:20 anonymous2 [View]
-
./configure issues
2003-07-30 16:26:03 anonymous2 [View]
-
WebDav set up for design group workflow
2003-05-31 17:31:39 kingdex [View]
-
Can't get past step one!
2003-05-31 09:21:25 anonymous2 [View]
-
Can't get past step one!
2003-05-31 10:24:02 anonymous2 [View]
-
Can't get past step one!
2003-09-14 23:20:47 anonymous2 [View]
-
iCal can't Publish
2003-05-21 15:26:41 midnightlightning [View]
-
DAVLock 10.2.4
2003-03-26 09:01:16 anonymous2 [View]
-
Can't Publish to Server
2003-03-19 17:22:20 hd7001 [View]
-
Can't Publish to Server
2003-05-21 15:26:01 midnightlightning [View]
-
can't publish to localhost (127.0.0.1)
2003-02-25 15:53:42 elmlish [View]
-
Can't publish to user Sites folder
2003-02-17 08:37:14 anonymous2 [View]
-
Can't publish to user Sites folder
2003-11-08 12:22:22 cpbjr [View]
-
Publishes but doesn't subscribe
2003-02-16 13:07:41 anonymous2 [View]
-
_XML errors
2003-02-06 14:32:58 wowmomnyc [View]
-
iMac, iCal, I stuck.
2003-01-22 16:40:27 anonymous2 [View]
-
Does not work
2002-11-11 02:01:20 anonymous2 [View]
-
Re: Does not work
2002-12-13 15:52:28 rspeed [View]
-
What about "Address Book"
2002-11-04 13:18:58 anonymous2 [View]
-
What about viewing w/o iCal?
2002-11-02 10:55:11 anonymous2 [View]
-
What about viewing w/o iCal?
2003-03-30 20:29:01 anonymous2 [View]
-
What about FreeBSD Unix?
2002-10-29 12:34:08 anonymous2 [View]
-
apache + webdav + WebObjects
2002-10-27 05:45:05 anonymous2 [View]
-
apache + webdav + WebObjects
2006-04-30 08:13:50 sweavo [View]
-
There are a few things I don't get
2002-10-16 18:57:07 anonymous2 [View]
-
Multiple "publishers" ?
2002-10-10 08:19:10 anonymous2 [View]
-
Buffy Calendar
2002-09-30 10:25:01 salamon [View]
-
re: Apple Laptop Keyboards Unsuitable for Unix Users
2002-09-30 08:47:16 anonymous2 [View]
-
Apple Laptop Keyboards Unsuitable for Unix Users
2002-09-28 21:58:15 anonymous2 [View]
-
Apple Laptop Keyboards Unsuitable for Unix Users
2003-06-09 16:25:41 anonymous2 [View]
-
Apple Laptop Keyboards Unsuitable for Unix Users
2002-09-30 10:42:46 sulrich [View]
-
mod_dav with php
2002-09-25 15:46:15 jawbrey [View]
-
mod_dav with php
2002-09-25 16:19:17 anonymous2 [View]
-
Expat error?
2002-09-24 12:20:14 anonymous2 [View]
-
Expat error? XML errors
2003-02-06 14:33:51 wowmomnyc [View]
-
Digest vs. Basic Authentication
2002-09-24 07:52:00 eray [View]
-
Digest vs. Basic Authentication
2002-09-24 14:56:55 mrprofessor [View]
-
Digest vs. Basic Authentication
2003-01-15 14:14:32 anonymous2 [View]
-
Clarifications
2002-09-23 21:33:55 Derrick Story |
[View]
-
Jaguar setup changed?
2002-09-23 19:30:06 anonymous2 [View]
-
this doesn't work as posted...
2002-09-23 18:14:47 anonymous2 [View]
-
this doesn't work as posted...
2003-03-28 15:42:16 anonymous2 [View]
-
Pathetic Security
2002-09-23 10:10:09 eray [View]
-
pathetic security
2002-09-23 06:53:02 mrprofessor [View]
-
htuser?
2002-09-22 12:55:48 anonymous2 [View]
-
htuser?
2002-09-21 19:18:48 anonymous2 [View]
-
htuser? Let me check into a fix
2002-09-22 23:25:09 Derrick Story |
[View]

