Enabling WebDav For CDN
Many people have asked me about setting up WebDav to directly address a CDN repository as a /local/path directory. This requires Coda file system (Advanced NFS) support. This particular tutorial is directed at people who wish to use WebDav support for a CDN, such as BitGravity (as in this example) on a Linux system. The particular flavor of Linux used in this tutorial is CentOS 5.2, so if you are using a different form of Linux the proceedure is similar, but will vary from distro to distro.
Install the Necessary Packages:
To access the necessary packages in Yum, the RPM repository needs to be up to date. I used the following commands to clean up Yum:
rpm -e yum-plugin-fastestmirror
yum clean all
yum install yum-metadata-parser yum-updatesd
yum install yum-plugin-fastestmirror
Once added, run the following installations:
yum install davfs2
yum install dkms
yum install dkms-fuse
yum install fuse
yum install fuse-davfs2
Verify that the Coda File System is Supported in the kernel:
For the WebDAV share to mount correctly, the module for the Coda file system needs to be supported by the kernel. To test if it is supported, run the following command command:
dmesg | grep -i coda
If the system returns an output, then everything should be fine, and the configuration of WebDAV can continue. However, if it responds with nothing, then the kernel does not support coda. To overcome this obstacle, the kernel source tree will need to be built so that the necessary coda files can be extracted.
Build the Kernel Source Tree and Add Coda Support
By building the kernel source tree, the necessary files for coda file system support can be manually compiled, and then copied into the current kernel’s library. In this way you don’t have to rebuild your running kernel.
During the most of the build procedure it is critical that it be performed as a non-root user to maintain the necessary permissions.
>> As root user or su – > Exit su -, or sudo to a non-root user, and continue with the following steps! .rpmmacros
Type “uname -ar” to display the kernel version, and then install the respective kernel source. For example:
rpm -i http://mirror.centos.org/centos/5/updates/SRPMS/kernel-2.6.18-92.1.18.el5.src.rpm 2> /dev/null
Now spec the kernel module version for this build with:
rpmbuild -bp –target=`uname -m` kernel-2.6.spec 2> prep-err.log | tee prep-out.log
After installing the kernel source tree, navigate to the install location, and start the build process:
cd ~/rpmbuild/BUILD/kernel-2.6.18/2.6.18.x86_64/
make oldconfig
Accept the default values [especially if you aren't sure].
make menuconfig
Browse the source tree menus to ‘File Systems’ –> ‘Network File Systems’ –> ‘Coda File System’. Type “m” for the value, which specifies modular support for coda.
Continue the build process with these commands:
make prepare
make modules_prepare
make M=fs/coda
With the build steps completed, the fruits of labor can be plucked from the kernel source tree:
>> As the root user, or su –