# Setting Up Webdav with Apache2

## rajl

Ok,

I have Apache 2, and I want to turn on the WebDAV features, mainly so I can publish my calendars from iCal to the web.  

I have -D DAV -D DAV_FS listed in my modules includes.  I also have ssl enabled and working, and want to only enable WebDav connections over ssl.

I also have user directories enabled.  Preferably, I'd want each user on the system to be able to publish to ~username/public_html and for the general public to be able to read html from there as well.

How is the best way to do this?  The information on the forums is sketchy at best, and the help is not really all that detailed.

----------

## Beau

bounce

Same question, same reason.

Did you find a solution yet?

----------

## bumpus

I did this and it works pretty well. I have phpicalendar installed in /home/httpd/calendar and I use WebDAV to put my calendars into /home/httpd/calendar/calendars with Mozilla Sunbird. SSL and a password are required to access the calendar by either a browser or WebDAV at https://calendar.my.domain.

The things you will need to do are:

1) Edit /etc/conf.d/apache2 and add "-D DAV -D DAV_FS"  to the apache2 opts line.

2) Edit /etc/apache2/conf/commonapache2.conf  and add a section similar to the following:

```

<Directory /home/httpd/calendar>

        Options -Indexes FollowSymLinks MultiViews

        AllowOverride All

        Dav On

        BrowserMatch "Microsoft Data Access Internet Publishing Provider" redire

ct-carefully

        AuthType Basic

        AuthName Calendar.my.domain

        AuthUserFile /home/httpd/.htpasswd-calendar

        require valid-user

        <IfModule mod_access.c>

                Order allow,deny

                Allow from all

        </IfModule>

</Directory>

```

3) Add the following to /etc/apache2/conf/vhosts/vhosts.conf:

```
<VirtualHost *:80>

ServerName calendar.my.domain

ServerAlias *.calendar.calendar.my.domain

Redirect / https://Calendar.my.domain/

</VirtualHost>

Include conf/vhosts/ssl.calendar.my.domain.conf

```

This will redirect all requests to http://calendar.my.domain to the corresponding address at https://calendar.my.domain

4) Create the ssl.calendar.my.domain.conf file. There should be an example file in the conf/vhosts directory. Just copy it to a new file and change the hostname and Document root to suit your needs and you should be set.

----------

## Crimson Rider

This may be a no brainer, but how do you configure iPhpCalender to do this ?

I can't find anywhere it the docs how to get that to work.

----------

## bumpus

I didn't have to do anything special with phpicalendar to get this to work. All I did was untar the code into my /home/httpd/calendar directory and put my calendar files into the /home/httpd/calendar/calendars directory and it just worked.

What part of phpicalendar are you having trouble with?

----------

