Thoughts, rants and commentary from a husband, father of five and professional web geek

Customizing Subversion Permissions

Posted on October 29th, 2007 in Apache Server, Geek Stuff | No Comments »

I spent the better part of the morning this morning learning how to set up Subversion to allow anonymous checkouts of repositories while maintaining authentication requirements for checking in. It was quite a learning lesson, but the Subversion book and several Google searches actually get things working the way I want them.

Anyway, what I had to do was modify my httpd.conf (this could potentially be done in the subversion.conf, but I have virtual hosted my svn repos so I made these changes in my httpd.conf) to change the way permissions were being served. Keep in mind that I am not usering svnserve to serve up my repos but am using Apache instead. The changes that I made to httpd.conf were inside the <Location> block set up for the virtual host for my subversion repos and look like:

<Location /repo-url-path>
  DAV svn
  SVNParentPath /path/to/repos

  # Taken from the sample on path based auth
  AuthzSVNAccessFile /path/to/repos/auth/authz

  # Try anonymous access first, resort to real
  # authentication if necessary.
  Satisfy Any
  Require valid-user

  # How to authenticate users
  AuthType Basic
  AuthName "Everah Projects Code Repositories"
  AuthUserFile /path/to/svn-auth-file
</Location>

As you can see, I created an AuthzSVNAccessFile named authz and put it in a directory called /auth/ that was off of my repos directory root. I then added the SVN instruction to use that file in my httpd.conf.

The next step was to add the Satisfy Any and Require valid-user lines after that but before the AuthType information. This tells SVN to look for permissions in the permissions file and apply those as described in the file. Then SVN is allowed to open up access to those that have it and require validation where it is required.

After I created the authz file I made it look something like this:
# Make groups for easier addition later on of permissions to contributors
[groups]
devs_all = robert
devs_padlock = robert

# NOTE: The repository name in the section header is the directory
# name off of /path/to/svn-repos/
#
# The path portion is the section of that repo. In this case, / means
# the entire friggin thing.
[TestRepo:/]
@devs_all = rw
* = r

[CodeRepo:/]
@devs_padlock = rw
* = r

[SecureRepo:/]
@devs_all = rw
* =

Once this was done, I restarted Apache and the changes were in effect.
[root@myserver /]# apachectl -k graceful

And now I have a Subversion install that allows for anonymous access to some of my repos while others still require authentication. And the repos that allow anonymous access still require authentication for checking in.

Sweet. I like being a nerd.


Resources to help you along the way
Using HTTPd (Apache) as your SVN Server
Authorization Options
Per Directory Authorization
Path-Based Authorization

Back to top

Essential tools for any PHP developer

Posted on July 27th, 2007 in Apache Server, MySQL, PHP, Web Development, Web Technologies | No Comments »

The following list was written by Chris Neale, of ooer.com fame, and reproduced with permission from the PHP Developers Network Forums

I’m sort of writing a new article listing all the things I use, or should use, to write awesome websites. If you fancy adding to the list then please do, it’d help.

The Obvious
PHP - I think we all know what this is.
MySQL - And this.
Apache - My personal choice of web server mainly because I understand htaccess.

Libraries
Swiftmailer - The best PHP mail sending library available bar none.
ADODB Lite - The best database abstraction layer around.
Template Lite - The best template engine.
FPDF - Awesome PDF library.
SHA256 - Hashing replacement for MD5/SHA1.
HTMLPurifier - Stop XSS attacks before they happen.
SimpleTest - Unit Testing library that’ll improve your code no end.
JQuery - Javascript AJAX/effects/make stuff easier type of thing.
JPGraph - Delightful library for charts and graphs in PHP.
ExCanvas - Get < canvas > working seamlessly in IE.

Browsers
Firefox - Best browser around.
Internet Explorer - Needed for testing because there’s still people who suffer it.
Opera - Again, needed for testing.
Safari - And again.

Extensions and Plugins
Web Developer - Absolutely critical for finding out information about the clientside things.
Firebug - Brilliant javascript console that makes AJAX so much less of a headache to debug.
YSlow - Site speed profiling plugin (needs Firebug).
NoScript - The easy way to test a site with JS and more switched off.
SearchStatus - Site search profiler, find out keyword information, page rank, Alexa rank etc.
XDebug - An awesome PHP debugger/profiler.

I’m not really interested in what editor/IDE you use, that’s a very personal choice. I’m interested in things that are absolutely top of their class couldn’t live without them essentials.

Any new developer would do well to glean something from this information.

Back to top