Apache Subversion Web Dev

Updating XP and Vista to support WebDAV Web Folders from Apache – Patch KB907306

If you are familiar with WebDAV or even Subversion and use Windows XP/Vista, you will appreciate this tidbit of information.

You can browse a WebDAV server in Windows XP and Vista using Windows Explorer. There is a problem though, Windows XP and Vista will try to use NTLM authentication (Active Directory) to authenticate with the server. If you configure your Apache WebDAV server with either no, basic or digest authentication, then you will hit a roadblock. Luckily Microsoft created the KB907306 patch. Unlucky for myself, other websites refer to the patch number missing the last digit ‘6’. This will drive you crazy when you know you should be able to copy/paste the KB number in Google and quickly find the download page on Other documents will say to search for KB90730. You should be searching for KB907306. You can search for “Software Update for Web Folders“, but you will also get a lot of other search results that are not nearly as helpful. Hopefully this blog post will save some folks the aggravation.

Now that you’re here, there is no need to search! The patch is available from the following link:

Apache PHP Subversion

Quick .htaccess to list files in directory on apache web server

If your web server to supports .htaccess files and you can specify “Options” from within your .htaccess file, then the following is a quick 1 line solution to your file listing needs.

So you just uploaded a tun of pictures to a web directory and you want a list of all the images.  Since the only types of files in the directory are images, the security risk of displaying the list diminishes.  In actuality, the list of images can be quite useful especially when trying to find a specific one.

The answer, create a 1 line .htaccess file with the following: Options Indexes

If you don’t have control over your apache configuration files and this option is not available to you, don’t fret.   Chris Snyder created an excellent php script that allows you to list the contents of a web directory.


This script is very useful, I’ve customized it for my subversion repository in order to display a list of repositories in the root of the subversion web server.


Subversion Repository Creation Script

I have been using Subversion (SVN) pretty heavily the past couple of weeks. I wanted a quick way to create a repository that included the standard trunk, branches and tags directories and set the correct owner and file permissions for the new repo. I came up with the following script. Please feel free to comment out sections you do not need.

#!/usr/bin/php -q
< ?php
define('REPO_PARENT_PATH', '/path/to/repos');
define('REPO_OWNER', 'devel_user:devel_group');
define('REPO_MOD', '770');

if( $argc < 2 )
        die("No repo name specified.\n\nUsage: addrepo.php repo_name\n\n");
$repo_name = $argv[1];
echo "Adding Repository: $repo_name\n\n";

// Create repositoryi
$repo_path = REPO_PARENT_PATH;
if( substr( $repo_path, strlen($repo_path)-1, 1) != '/' )
        $repo_path .= '/';
exec("svnadmin create $repo_path$repo_name");

// Add trunk
exec("svn mkdir file://$repo_path$repo_name/trunk -m "Add trunk"");

// Add branches
exec("svn mkdir file://$repo_path$repo_name/branches -m "Add branches"");

// Add tags
exec("svn mkdir file://$repo_path$repo_name/tags -m "Add tags"");

// Change file permissions
exec("chmod -R ".REPO_MOD." $repo_path$repo_name");

// Change file ownership
exec("chown -R ".REPO_OWNER." $repo_path$repo_name");

To use, execute the script from the shell one parameter being the name of your repository.

Example: ./addrepo.php repo_name