Just completing some upgrades to my service to incorporate subversion. I don't know how I got by without it for so long. My first exposure to version control software was Visual SourceSafe back in the dark ages, and since then I've either used that or similar routines involving backups and multiple versions in similarly-named folders. Subversion is a lean, command-line, open-source version of the same. Here's what I did.
In the case of MediaTemple, Subversion is already installed. All you have to do to get started is invoke a new instance on the command line.
svnadmin create /name/of/project/folder
Then build a project to import into svn, such as
tmp/project/trunk
tmp/project/branches
tmp/project/tags
Jump into the trunk and add some files to it
file1
file2
file3
When you import the project, subversion vacuums it all up.
svn import /tmp/project file:///name/of/project/folder -m "initial import"
Note the -m, ensures you won't get an error for not setting the default text editor for subversion. In case you would like to set it, just use the command:
export SVN_EDITOR=vi
Now you can checkout files using the checkout command
svn checkout file:///name/of/project/folder/trunk project
And you can post your revisions using commit
svn commit
Notice the difference in directory structure between creating, importing and checking out. Creating and importing require only the folder, but checking out requires the additional trunk folder and project name specified.
Here are some additional resources of note for subversion installations, with an emphasis on MediaTemple (dv) installations.
Ayman Hourieh Subversion Tutorial - quick and to the point.
Tony Spencer's Tutorial - includes basic WebDAV integration, also quick and to the point.
Showing posts with label server admin. Show all posts
Showing posts with label server admin. Show all posts
Wednesday, June 24, 2009
Monday, June 22, 2009
Python and Django in MediaTemple (dv) server
Getting Django to run on a dv server is not as easy as their preconfigured - and cheaper - grid containers. While the shared grid containers are ready to go out of the box, the dv has some server admin changes to get through before you see that welcome
"Hello World".
Specifically, the httpd.conf needs additional lines of code to connect the web root to the Django application. To add a little spin to it, there's also the config file generated by Plesk. That needs some edits as well.
The order of statements in the zz010_psa_httpd.conf file can be a particular obstacle. Seems you have to have the WSGIScriptAlias declarations high up in the page or they aren't acted on properly as the procedure continues. Changing LogLevels to info gives the most detailed view from your logfiles but may not ultimately identify the problems.
In any case, here are the steps in a nutshell:
(added to zz010_psa_httpd.conf - plesk)
Include /var/www/vhosts/urlone.com/conf/httpd.include
Include /var/www/vhosts/urltwo.com/conf/httpd.include
WSGIScriptAlias /myapp /var/www/vhosts/urlone.com/wsgi-scripts/myapp.wsgi
WSGIScriptAlias /django/test01 /var/www/vhosts/urltwo.com/wsgi-scripts/myapp.wsgi
(added both httpd.includes to file structure)
Seems simple enough once it works. I hope this gets you out of a pinch.
"Hello World".
Specifically, the httpd.conf needs additional lines of code to connect the web root to the Django application. To add a little spin to it, there's also the config file generated by Plesk. That needs some edits as well.
The order of statements in the zz010_psa_httpd.conf file can be a particular obstacle. Seems you have to have the WSGIScriptAlias declarations high up in the page or they aren't acted on properly as the procedure continues. Changing LogLevels to info gives the most detailed view from your logfiles but may not ultimately identify the problems.
In any case, here are the steps in a nutshell:
(added to zz010_psa_httpd.conf - plesk)
Include /var/www/vhosts/urlone.com/conf/httpd.include
Include /var/www/vhosts/urltwo.com/conf/httpd.include
WSGIScriptAlias /myapp /var/www/vhosts/urlone.com/wsgi-scripts/myapp.wsgi
WSGIScriptAlias /django/test01 /var/www/vhosts/urltwo.com/wsgi-scripts/myapp.wsgi
(added both httpd.includes to file structure)
Seems simple enough once it works. I hope this gets you out of a pinch.
Labels:
django,
python,
server admin,
web development
Subscribe to:
Posts (Atom)