audax321
January 19th, 2006, 06:37 AM
This tutorial works on Ubuntu and should work on Kubuntu as well as Xubuntu. However, we'll do all the text editing in nano (a console-based text editor) since it should be installed on all *buntus. For nano, after editing a file, to close it push CNTRL+X and it will ask you if you want to save and just respond accordingly.
Getting Sunbird:
Mozilla Sunbird is still in development so it may contains bugs, crash, or lost calendar data. You can download the latest version here:
http://www.mozilla.org/projects/calendar/sunbird/download.html
The nice thing about it is that there is NO compiling needed. Just put the folder wherever you want and run the 'sunbird' file inside the folder... or better yet make a nice icon pointing to the 'sunbird' file on your desktop or panel.
Getting a way to access the server:
If one of the following apply to you, skip this section:
1. You already have a hostname you can use to access the server you will be setting up.
2. You are only going to use this server on your local network and your computer has a static IP (your computer always gets the same IP).
3. You don't have a hostname and don't want one and you are assigned a static IP from your ISP.
If you want to share your calendars/files over the internet, then you need a "permanent" way to get to your server since a dynamic IP from your ISP can change. To get a hostname and setup a script on your computer to update the hostname everytime your ISP changes your IP follow the tutorial here:
http://ubuntuguide.org/wiki/Dapper#How_to_assign_Hostname_to_local_machine_wit h_dynamic_IP_using_free_DynDNS_service
If you are going to be only sharing your calendars/files over your local network, you need an IP assigned to you that is not always changing. To do this, log into the router on your LAN and tell it to assign the server you will be using the same IP (called assigning a Static IP).
Installing the Apache Server:
To install the Apache Server, open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
sudo apt-get install apache2
Now, you have the option of changing the port your Apache Server runs on. By default it runs on port 80, which is fine if there is only one computer. But if you setup a router to forward all traffic for port 80 to one computer on your network... the internet on your other computers will go bye-bye. To change the port:
sudo nano /etc/apache2/ports.conf
In the file add the following line, where "port" is whatever port you would like to use (e.g. Listen 9999) and then exit (CNTRL+X) and save:
Listen port
NOTE: Make sure to forward traffic on this port to your server if you have a router!!!
Enabling the WebDAV modules:
To enable the WebDAV modules, open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
sudo a2enmod
dav (enter)
sudo a2enmod
dav_fs (enter)
Setting up the WebDAV folder and the user:
This will make a WebDAV folder at: /var/www/davhome
To create the folder, open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
mkdir /var/www/davhome
chgrp www-data /var/www/davhome
chmod 775 /var/www/davhome
Next to create the user, input the following command changing the last "username" part of the command to the username you would like to use (obviously make a note of the username and password you create):
htpasswd -c /var/www/davhome/.DAVlogin username
Tell Apache where the folder is and to use it:
To tell Apache to use WebDAV, open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
sudo nano /etc/apache2/mods-enabled/dav_fs.conf
Thanks to henriquemaia for the suggesting to edit this file instead of /etc/apache2/httpd.conf
Paste the following into the file (make sure the Terminal window is selected and use the Paste command in the Edit menu (not CNTRL+V - nano won't recognize it):
Change "username" (two instances) to the username you created above. Also, the DAVMinTimeout is optional... it just sets the how long Apache should lock the file after it is accessed... I don't use it and haven't had a problem, but then again I only have one computer accessing the calendar at any time.
DAVLockDB /tmp/DAVLock
#DAVMinTimeout 600
<Location /davhome/>
Dav On
AuthType Basic
AuthName username
AuthUserFile /var/www/davhome/.DAVlogin
<LimitExcept OPTIONS>
Require user username
</LimitExcept>
</Location>
Hopefully you didn't exit and save yet because you have some more options. With the way the file is setup above you will be prompted for a username/password everytime you read or save a file using WebDAV.
If you don't want to be asked a password when you read a file change the first LimitExcept line to:
<LimitExcept GET OPTIONS>
If you don't want to be asked a password when you save a file (write) change the first LimitExcept line to:
<LimitExcept PUT OPTIONS>
If you don't want to be asked a password when reading or writing (not recommended unless you want to make the calendar completely public) change the first LimitExcept line to:
<LimitExcept GET PUT OPTIONS>
Okay, now you can exit and save.
Restart Apache
This step is very important so that Apache recognizes the changes you made!
Open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
sudo /etc/init.d/apache2 restart
The address to the server:
Now you can either create a new calendar in Sunbird and tell it to put it on your server or publish an existing local calendar to the WebDAV folder. Just go to the calendar tab in Sunbird and right-click in the list of calendars or right-click on an existing calendar in the list.
The address format you would enter for the remote calendar is as follows:
http://server_ip_or_hostname:port_if_not_80/davhome/filename_for_calendar.ics
Other Items to Note:
If you place an exisiting calendar file directly in /var/www/davhome, you should change the group and the rights on this file as follows:
sudo chgrp www-data /var/www/davhome/filename_for_calendar.ics
sudo chmod 644 /var/www/davhome/filename_for_calendar.ics
Thanks to bnj for this information.
If Sunbird does NOT create a new .ics file, do the following and point Sunbird to that file as if it is an existing calendar:
sudo touch /var/www/davhome/filename_for_calendar.ics
sudo chgrp www-data /var/www/davhome/filename_for_calendar.ics
sudo chmod 644 /var/www/davhome/filename_for_calendar.ics
Thanks to NobodySpecial for this information.
If I left anything out let me know and I'll add it, but that should be it. :)
Getting Sunbird:
Mozilla Sunbird is still in development so it may contains bugs, crash, or lost calendar data. You can download the latest version here:
http://www.mozilla.org/projects/calendar/sunbird/download.html
The nice thing about it is that there is NO compiling needed. Just put the folder wherever you want and run the 'sunbird' file inside the folder... or better yet make a nice icon pointing to the 'sunbird' file on your desktop or panel.
Getting a way to access the server:
If one of the following apply to you, skip this section:
1. You already have a hostname you can use to access the server you will be setting up.
2. You are only going to use this server on your local network and your computer has a static IP (your computer always gets the same IP).
3. You don't have a hostname and don't want one and you are assigned a static IP from your ISP.
If you want to share your calendars/files over the internet, then you need a "permanent" way to get to your server since a dynamic IP from your ISP can change. To get a hostname and setup a script on your computer to update the hostname everytime your ISP changes your IP follow the tutorial here:
http://ubuntuguide.org/wiki/Dapper#How_to_assign_Hostname_to_local_machine_wit h_dynamic_IP_using_free_DynDNS_service
If you are going to be only sharing your calendars/files over your local network, you need an IP assigned to you that is not always changing. To do this, log into the router on your LAN and tell it to assign the server you will be using the same IP (called assigning a Static IP).
Installing the Apache Server:
To install the Apache Server, open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
sudo apt-get install apache2
Now, you have the option of changing the port your Apache Server runs on. By default it runs on port 80, which is fine if there is only one computer. But if you setup a router to forward all traffic for port 80 to one computer on your network... the internet on your other computers will go bye-bye. To change the port:
sudo nano /etc/apache2/ports.conf
In the file add the following line, where "port" is whatever port you would like to use (e.g. Listen 9999) and then exit (CNTRL+X) and save:
Listen port
NOTE: Make sure to forward traffic on this port to your server if you have a router!!!
Enabling the WebDAV modules:
To enable the WebDAV modules, open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
sudo a2enmod
dav (enter)
sudo a2enmod
dav_fs (enter)
Setting up the WebDAV folder and the user:
This will make a WebDAV folder at: /var/www/davhome
To create the folder, open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
mkdir /var/www/davhome
chgrp www-data /var/www/davhome
chmod 775 /var/www/davhome
Next to create the user, input the following command changing the last "username" part of the command to the username you would like to use (obviously make a note of the username and password you create):
htpasswd -c /var/www/davhome/.DAVlogin username
Tell Apache where the folder is and to use it:
To tell Apache to use WebDAV, open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
sudo nano /etc/apache2/mods-enabled/dav_fs.conf
Thanks to henriquemaia for the suggesting to edit this file instead of /etc/apache2/httpd.conf
Paste the following into the file (make sure the Terminal window is selected and use the Paste command in the Edit menu (not CNTRL+V - nano won't recognize it):
Change "username" (two instances) to the username you created above. Also, the DAVMinTimeout is optional... it just sets the how long Apache should lock the file after it is accessed... I don't use it and haven't had a problem, but then again I only have one computer accessing the calendar at any time.
DAVLockDB /tmp/DAVLock
#DAVMinTimeout 600
<Location /davhome/>
Dav On
AuthType Basic
AuthName username
AuthUserFile /var/www/davhome/.DAVlogin
<LimitExcept OPTIONS>
Require user username
</LimitExcept>
</Location>
Hopefully you didn't exit and save yet because you have some more options. With the way the file is setup above you will be prompted for a username/password everytime you read or save a file using WebDAV.
If you don't want to be asked a password when you read a file change the first LimitExcept line to:
<LimitExcept GET OPTIONS>
If you don't want to be asked a password when you save a file (write) change the first LimitExcept line to:
<LimitExcept PUT OPTIONS>
If you don't want to be asked a password when reading or writing (not recommended unless you want to make the calendar completely public) change the first LimitExcept line to:
<LimitExcept GET PUT OPTIONS>
Okay, now you can exit and save.
Restart Apache
This step is very important so that Apache recognizes the changes you made!
Open up a Terminal (Applications > Accessories > Terminal) or whatever way works for your desktop:
sudo /etc/init.d/apache2 restart
The address to the server:
Now you can either create a new calendar in Sunbird and tell it to put it on your server or publish an existing local calendar to the WebDAV folder. Just go to the calendar tab in Sunbird and right-click in the list of calendars or right-click on an existing calendar in the list.
The address format you would enter for the remote calendar is as follows:
http://server_ip_or_hostname:port_if_not_80/davhome/filename_for_calendar.ics
Other Items to Note:
If you place an exisiting calendar file directly in /var/www/davhome, you should change the group and the rights on this file as follows:
sudo chgrp www-data /var/www/davhome/filename_for_calendar.ics
sudo chmod 644 /var/www/davhome/filename_for_calendar.ics
Thanks to bnj for this information.
If Sunbird does NOT create a new .ics file, do the following and point Sunbird to that file as if it is an existing calendar:
sudo touch /var/www/davhome/filename_for_calendar.ics
sudo chgrp www-data /var/www/davhome/filename_for_calendar.ics
sudo chmod 644 /var/www/davhome/filename_for_calendar.ics
Thanks to NobodySpecial for this information.
If I left anything out let me know and I'll add it, but that should be it. :)