11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Server ConfigurationSetting up HTTP authenticationThe easiest way to authenticate a client is via the HTTP Basic authentication mechanism,which simply uses a username and password to verify that a user is who she says she is.Apache provides an htpasswd utility for managing the list of acceptable usernames andpasswords. Let's grant commit access to Sally and Harry. First, we need to add them to thepassword file:$ ### First time: use -c to create the file$ ### Use -m to use MD5 encryption of the password, which is more secure$ htpasswd -cm /etc/svn-auth-file harryNew password: *****Re-type new password: *****Adding password for user harry$ htpasswd -m /etc/svn-auth-file sallyNew password: *******Re-type new password: *******Adding password for user sally$Next, you need to add some more httpd.conf directives inside your Location block totell Apache what to do <strong>with</strong> your new password file. The AuthType directive specifies thetype of authentication system to use. In this case, we want to specify the Basic authenticationsystem. AuthName is an arbitrary name that you give for the authentication domain.Most browsers will display this name in the pop-up dialog box when the browser is queryingthe user for her name and password. Finally, use the AuthUserFile directive to specifythe location of the password file you created using htpasswd.After adding these three directives, your block should look something likethis:DAV svnSVNParentPath /var/svnAuthType BasicAuthName "<strong>Subversion</strong> repository"AuthUserFile /etc/svn-auth-fileThis block is not yet complete, and it will not do anything useful. It's merelytelling Apache that whenever authorization is required, Apache should harvest a usernameand password from the <strong>Subversion</strong> client. What's missing here, however, are directivesthat tell Apache which sorts of client requests require authorization. Wherever authorizationis required, Apache will demand authentication as well. The simplest thing to do is protectall requests. Adding Require valid-user tells Apache that all requests require an authenticateduser:DAV svnSVNParentPath /var/svnAuthType BasicAuthName "<strong>Subversion</strong> repository"AuthUserFile /etc/svn-auth-fileRequire valid-userBe sure to read the next section (the section called “Authorization Options”) for more detailon the Require directive and other ways to set authorization policies.173

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!