I want to access my calendar and addressbook from my mainframe and from my notebook. I write exams at the moment so it is the best time to do something else. I’ve setup a webdav to store my adressbook and calendar so I can access it with KOrganizer, Mozilla Sunbird or KAdressbook from everywhere.
First we have to create a directory for the webdav databases (lock, user).
Now we need a user
Change <username> to your user and enter a password. Now lets create the web accessible directory.
The next step is to create a config file and add the dav modules.
Edit /etc/sysconfig/apache2 and add “dav” and “dav_fs” to the APACHE_MODULES variable. Then create a file /etc/apache2/mod_dav.conf with the following content:
<IfModule mod_dav_fs.c> # Location of the WebDAV lock database. DAVLockDB /var/lib/apache2/dav/lockdb </IfModule> <IfModule mod_dav.c> # XML request bodies are loaded into memory; # limit to 128K by default LimitXMLRequestBody 131072 # Location of the WebDav Repository. Alias /webdav "/srv/www/webdav" <Directory /srv/www/webdav> # enable webdav for this directory Dav On Options +Indexes IndexOptions FancyIndexing AddDefaultCharset UTF-8 AuthType Basic AuthName "WebDAV Server" # htpasswd2 -c /etc/apache2/dav_users.db <username> AuthUserFile /etc/apache2/dav_users.db <LimitExcept GET OPTIONS> Require valid-user </LimitExcept> Order allow,deny Allow from all </Directory> </IfModule>
and include it in /etc/httpd.conf
Now you can access your webdav directory with http://domain.tld/webdav
I’m sure you want to access your server the secure way, so we need mod_ssl and a certificate. I have an CACert account so I created a real one
You have to create a CSR (Certificate Signing Request) for CACert. This file contains pieces of information about your cert and your public key.
It is used by the Certification Authority to sign your cert.
Generate an encrypted key
Type the following command to generate a private key that is file encrypted.
You will be prompted for the password to access the file and also when starting your webserver. Warning: If you lose or forget the passphrase, you must generate another certificate.
If you decide at a later stage that you would rather use an unencrypted key (cause you don’t want to enter the key at boot time), you may create an unencrypted version of server.key in server.key.unsecure by executing:
Request a Server Certificate
Log in to your CACert account and post the CSR, you’ll will receiver the server.crt by mail. Replace the server.key in /etc/apache2/ssl.key and server.crt in /etc/apache2/ssl.crt with your CSR and your cert.
Edit in /etc/sysconfig/apache2 the add to APACHE_SERVER_FLAGS the option -DSSL. Restart your apache2 and connect e.g. with konqueror to your webdav and log in: