Plesk and WebDav

Need to get WebDav running on a directory within a domain hosted on Plesk 8.4 for Linux (Fedora 8).

These URLs were helpful:

Created the following files: /var/www/vhost/domain.com/conf/vhost.conf and /var/www/vhost/domain.com/conf/vhost_ssl.conf

And populated them with:

# vhost.conf
Alias /webdav_directory /var/www/vhosts/domain.com/httpdocs/webdav_directory
<Location /managementdocs>
DAV On
Options +Indexes
</Location>

And…

# vhost_ssl.conf
Alias /webdav_directory /var/www/vhosts/domain.com/httpdocs/webdav_directory
<Location /managementdocs>
DAV On
SSLRequireSSL
Options +Indexes
</Location>

Obviously you don’t need both as you may just want it accessible via HTTPs.

Then, rebuilt the Plesk webserver configuration file with the following command:  /usr/local/psa/admin/sbin/websrvmng –reconfigure-vhost –vhost-name=domain.com

This appeared to work and allowed adding the URL via windows “Add new network place”.

Other commands we issued (allowing read/write from the apache/psacln user – could possibly do this with chmod 2775?):

 chmod 777 /var/www/vhosts/domain.com/httpdocs/webdav_directory

Also, you probably don’t want it accessible from anyone and everyone.  You can add password authentication via the Plesk interface using protected directories.

Manually backup databases managed by plesk for linux

 Wrote a quick little script to get all the mysql database names managed by Plesk for linux and then manually back them up.

#!/bin/bash

MYSQLPASS=`cat /etc/psa/.psa.shadow`
# Day of week
DAY=`date +%u`
DIR=”/mnt/backup/mysql”

# Backup mysql database
mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` -c -e –add-drop-table –add-locks –allow-keywords mysql > $DIR/mysql.$DAY.sql

for DB in `mysql -Ns -uadmin -p$MYSQLPASS -Dpsa -e “select name from data_bases”`;
do mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` -c -e –add-drop-table –add-locks –allow-keywords $DB > $DIR/$DB.$DAY.sql;
done