VMware Images:
|
How To Set Up WebDAV With MySQL Authentication On Apache2 (Debian Etch)
How To Set Up WebDAV With MySQL Authentication On Apache2 (Debian Etch)Version 1.0 This guide explains how to set up WebDAV with MySQL authentication (using mod_auth_mysql) on Apache2 on a Debian Etch server. WebDAV stands for Web-based Distributed Authoring and Versioning and is a set of extensions to the HTTP protocol that allow users to directly edit files on the Apache server so that they do not need to be downloaded/uploaded via FTP. Of course, WebDAV can also be used to upload and download files. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI'm using a Debian Etch server with the hostname server1.example.com and the IP address 192.168.0.100 here.
2 Installing Apache2, WebDAV, MySQL, mod_auth_mysqlUnfortunately libapache2-mod-auth-mysql is available as a Debian package only for Debian Lenny (testing) and Sid (unstable), but not for Etch. Therefore we will install the libapache2-mod-auth-mysql package from Lenny. To do this, open /etc/apt/sources.list and add the line deb http://ftp2.de.debian.org/debian/ lenny main; your /etc/apt/sources.list could then look like this: vi /etc/apt/sources.list
Of course (in order not to mess up our system), we want to install packages from Lenny only if there's no appropriate package from Etch - if there are packages from Etch and Lenny, we want to install the one from Etch. To do this, we give packages from Etch a higher priority in /etc/apt/preferences: vi /etc/apt/preferences
(The terms etch and lenny refer to the appropriate terms in /etc/apt/sources.list; if you're using stable and testing there, you must use stable and testing instead of etch and lenny in /etc/apt/preferences as well.) Afterwards, we update our packages database: apt-get update If you're getting an error like this: Segmentation faultsts... 96% or this one: E: Dynamic MMap ran out of room open /etc/apt/apt.conf and add a line for APT::Cache-Limit with a very high value, e.g. like this: vi /etc/apt/apt.conf
Then run apt-get update again and upgrade the installed packages: apt-get upgrade (If you see any questions, you can accept the default values.) To install Apache2, WebDAV, MySQL, and mod_auth_mysql, we run: apt-get install apache2 mysql-server mysql-client libapache2-mod-auth-mysql Create a password for the MySQL user root (replace yourrootsqlpassword with the password you want to use): mysqladmin -u root password yourrootsqlpassword Then check with netstat -tap | grep mysql on which addresses MySQL is listening. If the output looks like this: tcp 0 0 localhost.localdo:mysql *:* LISTEN 2713/mysqld which means MySQL is listening on localhost.localdomain only, then you're safe with the password you set before. But if the output looks like this: tcp 0 0 *:mysql *:* LISTEN 2713/mysqld you should set a MySQL password for your hostname, too, because otherwise anybody can access your database and modify data: mysqladmin -h server1.example.com -u root password yourrootsqlpassword Afterwards, enable the WebDAV and mod_auth_mysql modules: a2enmod dav_fs Reload Apache: /etc/init.d/apache2 force-reload
3 Creating A Virtual HostI will now create a default Apache vhost in the directory /var/www/web1/web. For this purpose, I will modify the default Apache vhost configuration in /etc/apache2/sites-available/default. If you already have a vhost for which you'd like to enable WebDAV, you must adjust this tutorial to your situation. First, we create the directory /var/www/web1/web and make the Apache user (www-data) the owner of that directory: mkdir -p /var/www/web1/web Then we back up the default Apache vhost configuration (/etc/apache2/sites-available/default) and create our own one: mv /etc/apache2/sites-available/default /etc/apache2/sites-available/default_orig
Then reload Apache: /etc/init.d/apache2 reload
|



Recent comments
20 hours 15 min ago
21 hours 24 min ago
23 hours 18 min ago
1 day 17 min ago
1 day 31 min ago
1 day 3 hours ago
1 day 5 hours ago
1 day 7 hours ago
1 day 21 hours ago
2 days 13 hours ago