At any rate, when publishing things for the world to see, you also have to be careful about only allowing the world access to the things they really need to see. While I doubt that your mother or your husband or even that nice guy at work with the mustache would ever take advantage of access to your computer to do something harmful, there are people out there who will. And yes, they can and will find your computer, using all sorts of nefarious methods. So in the information below I'll try to show how to lock up your published calendars fairly tightly. If you want to have more security, more power to you (just ask me, or preferably someone with more knowledge about this sort of thing, how). If you want less security, that's OK, but just realize what you're doing. Finally, know that you don't have to do this if you feel uncomfortable - there are other ways to get your calendar published, even without subscribing to .Mac. Try searching Google to find services that will let you publish your calendars to their servers. As of this writing, I've heard of iCal Exchange in particular, though I can't vouch its services. Third-party developers have also made it possible to publish via other methods, such as FTP. One tool for this is iCal FTP for OS X.
You are enabling WebDAV, which is already installed, as an extension to the Apache web server. I don't know of a way to do this without using the Terminal, and you need an administrator account so you can edit things that apply not only to a single user, but to the whole computer (if you only have one user on your computer, this might sound confusing, but there really are good reasons for it. Luckily, you should automatically be an administrator if you only have one user). First, open a Terminal window. If you don't know how to use the Terminal to read and edit files, read The Quick and Dirty on the Terminal and Text Editors before continuing. It explains how to set up the Terminal for easy use in OS X, and how to use it to edit text. You will need to edit the Apache configuration file. This requires root access, for which we can use a tool called 'sudo'. If you've never used this before, be careful. Sudo can allow you to change all sorts of things you shouldn't, so after doing what I describe, close your terminal and run away, or make darn sure you know what you're doing. Ok, so on to the instructions. Sorry to keep you waiting.
Now, search for First, set up a location for the 'lockfiles' for WebDAV. This location can be most anywhere on your computer, but it shouldn't be in your web tree (it shouldn't be in /Library/WebServer/Documents). I used /Library/WebServer/davlocks/. If you don't use this directory, remember that later when I describe how to set that location up. # CHANGES BY GREG WESTIN - Turning on WebDAV DAVLockDB /Library/WebServer/davlocks/DAVLockDB DAVMinTimeout 600 Next, you need to turn WebDAV on specifically for a certain location. We don't want to turn it on everywhere because, as I said before, we only want to allow the permissions necessary for our purposes. I decided to put all my iCal files in a folder called "ical" at the top of my web tree. You can choose a different name, just remember to change all the references below. <Location /ical> DAV On AllowOverride None Options None Now, you could be finished here, simply by putting in a closing AuthType Digest AuthName "webdav access" AuthDigestFile "/etc/httpd/passwords/webdav.digest" <LimitExcept GET HEAD OPTIONS> require user greg melissa </LimitExcept> Note: This setup uses so-called "Digest" authentication because it is more secure than "Basic" authentication, which sends your password in plain text. However, not all browsers can handle digest authentication. If you want to use Basic authentication, see the fourth FAQ at the bottom of this page. Next, we want to allow any valid user in our passwords file to get things from this directory. I set up a 'guest' user, but you can set up individual users for your friends if you want, or not give anyone else access if you so choose. <Limit GET HEAD OPTIONS> require valid-user </Limit> </Location> Ok, you should be done editing the httpd.conf file, so save and close it. If you have PHP enabled, however, or plan on enabling it, be sure to read the first FAQ on this page before finishing up with the httpd.conf file.
First, the lockfile directory. Type "sudo mkdir /Library/WebServer/davlocks" and hit return to make the 'davlocks' directory. Now you need to make it 'owned' by the username that Apache uses, www. Type Ok, done with that. Now let's set up the 'ical' directory. It's just like above: Last, let's set up those passwords. For this, we use the 'htdigest' command. First, make the directory that will contain this file: Ok, you should be all set. Close that file, then simply type http://ical.gregwestin.com/icalTo subscribe, people use: webcal://ical.gregwestin.com/ical/calendar.ics
In your case, you might not have your own domain name set up, and if you do, may not have the 'ical' subdomain set up. No problem. Your info might use 'www.mydomain.com' instead of 'ical.gregwestin.com', or it might use an IP address, in which case it would look something like (using a sample IP address of 140.247.145.23): To publish:http://140.247.145.23/icalTo subscribe: webcal://140.247.145.23/ical/calendar.ics
This only works, of course, if you have a fixed IP address. If you know you have one, you can find it in the 'Network' pane in your System Preferences. If you don't know, ask your provider. If you don't have a fixed IP address, check out a solution using dynamic DNS, with a service like zoneedit.com or hn.org. Also, remember to substitute the proper calendar name, capitalized if need be, for "calendar" when subscribing. That's it! Please let me know if there are any problems with these instructions. Finally, if you want a way to be able to view these calendars online, in addition to being able to let other people subscribe to or download them, be sure to check out my hints on getting started with PHPiCalendar. -Greg Frequently Asked Questions:
The most likely problem is that you thought you had PHP installed, but you need to upgrade to an appropriate compile of PHP for your version of OS X. You can find these on Marc Liyanage's web site. Also, make sure the DAV module is loaded and enabled after PHP in your httpd.conf file. This means moving the Line that begins with The other possibility I can think of is that there might be some problems with the httpd.conf file you copied from your previous installation of OS X or which came with your current version. Make sure you have this line commented out at the end of the LoadModule sequence: #LoadModule hfs_apple_module libexec/httpd/mod_hfs_apple.so Also comment out the corresponding value in the AddModule sequence. If none of that works, check your system logs, and send me the relevant lines, or post them in an Apple Discussions Forum.
The most likely explanation is that you made a typo when setting up your passwords file with To create the first user's password: sudo htdigest -c /etc/httpd/passwords/webdav.digest "webdav access" greg To create subsequent users' passwords: sudo htdigest /etc/httpd/passwords/webdav.digest "webdav access" guest
When connecting with this sort of program, users need access to the PROPFIND method, in addition to GET, HEAD, and OPTION. So if you want these users to be able to see a list of your files, and connect using programs like "Connect to Server," simply add PROPFIND to the list of properties in the relevant section of your httpd.conf file: <LimitExcept GET HEAD OPTIONS PROPFIND> require user greg melissa </LimitExcept> <Limit GET HEAD OPTIONS PROPFIND> require valid-user </Limit> There may well be other methods needed to allow users to do various other things you might want to allow them to do. Since this page is focused upon WebDAV for use with Apple's iCal, however, and since I'm not an expert on WebDAV by any stretch of the imagination, I'll leave it to others to explain other such uses of WebDAV.
Simply replace the three relevant httpd.conf lines above (from the "AuthType" line through the AuthDigestFile" line) with these: AuthType Basic AuthName "webdav access" AuthUserFile "/etc/httpd/passwords/webdav.access" Also, you need to create a different sort of password file. Rather than using the 'htdigest' command, do the following (after creating the 'passwords' directory as described above): Use the 'htpasswd' command with the -c option to create the file (remember to substitute the username you want for 'greg'): |