Click the box titles below to expand:
How to's
XSLT
GOOGLE MAPS API
PHP
- PHP & Web Services — using SOAP to get meteorological data for a location
- PHP and Flickr accessing online photos through the phpFlickr class
Perl
Document Object Model (DOM)
UNIX
- Various snippets that make my life easier
- Create an Antelope Mail Archive
- Adding new projects to the Antelope contrib area using CVS
- Using Subversion to version control web sites
Generic Mapping Tools (GMT)
Miscellaneous
Projects
Courses Taught
Latest Favorites
- Make your pages load faster by combining and compressing javascript and css files
- Creating Liquid Faux Columns
- Setting up SSL under Apache 2 on SuSE
- PHP editing with ViM
- Getting equal-height columns in a three-column layout
- Star html Selector Bug
- Reset MySQL root account permissions
- How to write UNIX man pages
- Son of Suckerfish Dropdowns
- Aidan's PHP Repository
- Adium IM client
- ShapeShifter
- Install wiki on an iBook
- Quirksmode
- PHP
- GD
- JpGraph
- Vim Text Editor
- Generic Mapping Tools (GMT)
Mac OS X
Web Development
Beta
How To :: Using Subversion to version control web sites
Subversion is a suite of software to allow version control of software development projects. What I aim to do here is just document (for myself, co–workers and anyone else) how I got it set up as a client on my Apple G4 OS X Tiger, and how I go about beta–testing and backing–up web projects.
1. Tools for the job
Here is a list of the software I installed to get Subversion working on OS X:
- Fink and Fink Commander: If you use OS X and UNIX you should know all about Fink. If not, go check it out....
- Subversion - I actually installed it using Fink and Fink Commander. If you like you can get the latest disk image from Martin Ott.
- SCPlugin – I got version 269.
- svnX – I got version 0.9.6.1 (0.9.6.1)
You just need to install the Subversion client. I installed the secure sockets layer (SSL) version of the client: svn-client-ssl 1.1.4-11. To install this, Fink also required Python to be installed, which it did automatically (after asking me if it was ok to do so).
Here is one persons log of getting Subversion running on OS X – very useful:
- Setting up the subversion client on Mac OS X (Note that his shell env is bash – mine is tsch).
Here is a Subversion cheat sheet with the basic commands – clear and concise:
Test that you have subversion installed correctly by typing:
hostname {username} %1> which svn
or:
hostname {username} %2> svn help
2. Access to import, commit, add files to your subversion repository
First up, if you haven't already, create authorized keys on your own host and the Subversion repository host:
I did this using ssh-keygen and here are some links that I found useful:
- man ssh, man ssh-keygen, man ssh-add – obviously....
- Getting started with SSH
- OpenSSH: Secure Shell: A Brief Tutorial on Setup and Use
3. Create an initial repository for your projects
Log in to the host that will be storing the repository:
hostname {username} %1> svnadmin create /path/to/your/repository
4. Import your first project into the repository:
I did this the first time from the command line. Helpful information was found here.
hostname {username} %3> svn import myproject svn+ssh://hostname/path/to/your/repository/
5. Check out a copy into your own sandbox
So now we have a project in the repository. To make any changes to this I make a directory (sandbox) and check out the project to that area:
hostname {username} %4> mkdir sandbox
hostname {username} %5> cd sandbox
hostname {username} %6> svn checkout https://hostname/path/to/your/myrepository/myproject myproject
So now I have my own personal copy of the project. If I make any changes to these files I need to commit them, if I add a new file I need to add them to the repository.
6. Errors!
What about if you make a mistake and accidentially import a project? Use svn delete:
hostname {username} %7> svn import dumbproj https://hostname/path/to/your/repository/dumbproj
Adding ......
Adding ......
Committed revision 1.
hostname {username} %8> svn delete -m "Deleting dumb project" https://hostname/path/to/your/repository/dumbproj
Committed revision 2.
7. Using svn
To use subversion you now just need to check the file into the repository:
hostname {username} %9> svn ci -m "Fix header codes" index.php
Password:
Sending index.php
Committed revision 197.
If you want to add CVS style tags (like $Id$, $Revision$, etc) you need to set the properties to the file in question:
hostname {username} %10> svn propset svn:keywords "Id Revision" index.php
property 'svn:keywords' set on 'index.php'
Then check the file in again to see those tags with metadata added to them.
To get the latest version of the file in your production (or 'live') site, just do an update:
hostname {username} %10> svn update
Password:
U index.php
Updated to revision 197.
Troubleshooting
- Version skew: After errors trying to update via svn+ssh and also https we found out that the Apache run time library got updated but svn wasn't. To fix my sysadmin forced svn to go to a known version. This resolved the problem. The error was not apparent – I could run the import command and enter my comment in the Vi window, but after entering my password to import to the remote host I go this error:
svn: Valid UTF-8 data (hex: 46) followed by invalid UTF-8 sequence (hex: f8)
Disclaimer
This information is freely provided as–is. Messing around with the command line and creating files is a serious business, and I accept no liability for errors created, systems corrupted, or hard–disk damage by you following these instructions. They worked for me but may not work for you. Remember to back–up EVERYTHING before you try any of this stuff — it is not simple OR easy!!!
If you have any questions about this please email me at rlnewman@ucsd.edu and I will try my best to help you out.