15

I'm just learning how to do things, and want to start using some sort of version control for a web app.

What's most appropriate for deploying a python or php web app on my own? I'm using linux and have a linux server.

Thanks!

Rich Bradshaw
  • 71,795
  • 44
  • 182
  • 241
  • 8
    Congratulations on realising that version control isn't just for sharing code between multiple developers - not many people work this out. – belugabob Dec 01 '08 at 15:53

19 Answers19

18

SVN, but you need to be able to easily deploy your webapp with SVN.

Since it is not always a simple task, so I just point out this article which may be of interest for your project.

General principle:

  • Configure Apache on your development server so that it picks up your checked out working copies as separate subdomains. Using this, you can simply make a checkout of your project and it will automagically be up and running. No need to touch the Apache configuration. You need a DNS wildcard entry so that all subdomains of dev.example.org go to your development server.

The only problem with using the above Apache configuration locally is the DNS wildcard. Unless your desktop is assigned a hostname by your network's DNS server and you can set the wildcard there, you will have to make do with your localhost address. You can install dnsmasq to act as a local caching DNS server and put the wildcard on your own machine

  • Use dnsmasq so you can achieve the same effect on your own development machine. That way you can develop your web applications locally and you won't need a central development server. In my examples I will be assuming you use subversion for your version control, but it works virtually the same with other version control packages, such as git or bazaar.

Note: (Humor)
This other question on Subversion allowed me to point out to this article about publishing its (source-controlled) data into production, with in it probably the ugliest diagram I ever saw on the topic ;-)

diagram

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
14

If I had not bumped into git, I would've doubtless gone with SVN. Having said that, I would recommend git.

ayaz
  • 10,406
  • 6
  • 33
  • 48
  • He is alone and want to learn source control, git seem not to be the good choice for that... – Patrick Desjardins Dec 01 '08 at 13:41
  • 4
    Decentralized version control is perfectly well suited for a one-man "team", especially as it does away with the separate server. I don't use git, so can't say how useful that in particular is though. But Bazaar would work well, and is ridiculously easy to set up – jalf Dec 01 '08 at 14:18
8

Nowadays, I would certainly go with a distributed version control system. Setup is faster since you don't need to set up a version control server and everything, all you usually need to do is initialize a certain directory within your development box for version control and you're good to go. They also seem like the way to go these days. If it were 2001, I would recommend a centralized system like Subversion. But it's 2008, everyone is moving to distributed systems and user interfaces and supporting tools tend to get better.

Here are some suggestions for you:

  • Darcs: Easy to learn and has all the features you will usually need
  • Mercurial
  • Git: Powerful. May take some time to understand but evolves rapidly

All three of them should be readily available in your Linux-based OS through the usual package management solutions.

Thiago Arrais
  • 33,360
  • 7
  • 30
  • 34
5

SVN is great.

5

Nowadays the hype around DVCS.

I prefer Bazaar.

Because of it's name, the support, the feature set, and it works well on my window$ machine too.

Zsolt Botykai
  • 50,406
  • 14
  • 85
  • 110
  • Don't forget "it's easy to set up". In particular, being able to push to any FTP server, without having to install special software, is really handy. – jalf Dec 01 '08 at 14:18
  • I second that. Bazaar is nice! – l3dx Feb 05 '09 at 08:52
3

I'm using unfuddle.com and I love it. It's free for a one person web app

GregD
  • 6,860
  • 5
  • 34
  • 61
2

The answer really depends on your way of thinking. I personally had problems switching to subversion from SourceSafe. If you come from microsoft shop, I'd suggest using SourceGear Vault, it is free for <=2 users. If you come from non microsoft area, then using subversion would be preferrable. Also please consider git if working on linux. HTH, Valve.

Valentin V
  • 24,971
  • 33
  • 103
  • 152
2

Personally I use monotone, learning a DVCS is definitely the way forward.

Phil Hannent
  • 12,047
  • 17
  • 71
  • 118
1

For a one-man job, pretty much any revision control system will do the job. It's when you get into multiple people, and past that into multiple repositories, where there start to be differences.

Given that, I'd go with whatever Free Software system your development environment supports best. I see Subversion and Git mentioned and both are fine choices.

T.E.D.
  • 44,016
  • 10
  • 73
  • 134
0

SVN would been my first choice. If I have to take a second choice I would go to CVS.

Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
0

One of the most popular models out there today is Subversion. It's generally easy to setup & configure and is able to handle multiple platforms.

Steve Brouillard
  • 3,256
  • 5
  • 41
  • 60
0

SVN. If one does not need concurrent access (which is your case), it is VERY easy to setup as no server is required at all. Definitely your weapon of choice.

petr k.
  • 8,040
  • 7
  • 41
  • 52
  • Do yourself a favor and set up the server anyways. Using the direct file:// access methods will cause you pain in the future when you try to convert it to using a server because someone joined your team, etc. Also, remote access is awesomely useful. – rmeador Dec 01 '08 at 13:53
  • How exactly does it cause you any pain in the future? Making the repository available through http (or ssh or whatever) is seamless, without any added cost, it is as simple as moving the repository folder into another location. – petr k. Dec 20 '08 at 03:58
0

I wholeheartedly agree with SVN. Command-line SVN is quite easy too.

Kieran Senior
  • 17,960
  • 26
  • 94
  • 138
0

While I like svn a lot, I've found mercurial handy for having the whole repository locally. (the same goes for git, but its interface is a little less polished in my opinion.)

0

I once used Perforce and was impressed with it. There's GUI and command line versions and it supports Windows, Linux, Mac and Unix for both the server and client. It integrates with Eclipse and has APIs for writing your own client applications (C/C++, Ruby, Perl, Python) It only supports two users and five workspaces before you need to buy licenses though (but that is within the scope of this question).

Skizz
  • 69,698
  • 10
  • 71
  • 108
0

I'm not able to answer the question as asked, because I don't develop on a Linux server.

But maybe this experience has a counterpart in Linux world.

I use a local-on-my-LAN-only IIS server (actually on an old laptop that no longer travels but works as a little server). I have VSS installed on that server too. There is an integration between the IIS Server, the FrontPage extensions on that server, and the VSS.

The upshot is that I can use FrontPage to build and edit my site and build a development image that is always backed up in VSS, and I can check out, check in, and do all of that from within FrontPage.

Now, the way I publish is I take advantage of the sharing capability of VSS so I have a deployment image that shares with the project that is actually an IIS web site. I have a deployment-image directory that I can transfer the latest checked-in material to (material that has not changed is not updated). I then deploy the deployment image to the hosted, public web site using FTP (again, only transfering new and updated files).

I present all of these details to suggest what might be the use-case of interest, even though a different solution approach is needed with Linux.

If I wasn't using a tool that integrated with the web server and also the source control at the server, I could do something similar by checking the VSS material in and out of a local directory and then pushing the updated VSS project to the IIS server web-pages directory hierarchy. The workflow is a little more clumsy. In this case, I would not edit pages directly on the development web server unless I could lock check-in pages as read-only or something.

Does this suggest anything that might be appealing in the Linux server case?

orcmid
  • 2,618
  • 19
  • 20
0

Definitively Mercurial is a good choice, quick, easy to use, perfect for working alone, or with multiple other developer, perfectly multiplateform, handles merges, branches, etc. very simply, plugin based, there are great tools out there such as nice IDE plugins (notably Netbeans and Eclipse).

Robust, it works just as you a expect such a tool to work, not like SVN (and I have years of day to day)...

Both Sun, Xen and Mozilla host all their repos on Mercurial. We're currently moving from SVN to Mercurial after a 6 month daily test, without any regret.

temsa
  • 305
  • 2
  • 3
  • 8
-1

CVS - No, I'm not joking. Not that it is better (it is not) or the simplest (it isn't), but it really doesn't matter at the end of the day. The important thing is to get started with ANY version control system even if it is a one-developer shop, even if it is CVS.

luis.espinal
  • 10,331
  • 6
  • 39
  • 55
  • No way. The only good thing that can be said about CVS is that it isn't V*sual S*urceS*fe, which isn't much. – nobody Apr 02 '10 at 00:19
  • 1
    I dunno. I've worked with it with simple and large, complex systems and it did the job excellently. It shows its age, though, compared to other tools. Truth to be told, I'd pick Mercurial as "the best", but in the end it really becomes a subjective opinion for most. My original point in bringing CVS is that 1) if you are good (suck) in source control, you will be good (or will suck) in any; and 2) CVS can be a good starting point because what is important is to have the source controlled and versioned no matter with what. – luis.espinal Apr 02 '10 at 11:01
  • Interesting how I got modded down for this. Whatever. Fanboys can have it if that makes them happy :) – luis.espinal Apr 03 '10 at 22:49
-1

Subversion is a good choice. For the client, there's TortoiseSVN (http://tortoisesvn.tigris.org/) that integrates with the shell and lets you do things with a right click on a folder. For integration with Visual Studio (I'll assume that's your environment) there's VisualSVN (http://www.visualsvn.com/) and AnhkSVN (http://ankhsvn.open.collab.net/). For the server there's a one-click installer you can find here (http://svn1clicksetup.tigris.org/) that does the setup in a snap. VisualSVN also has a (free) server that you can use which provides it's own web access and security (rather than using apache) and has a mmc-snapin for managing/creating repositories and users.

Bil Simser
  • 1,713
  • 1
  • 19
  • 27
  • Try reading the question. He specifically says "PHP and Python on Linux." – Robert S. Dec 01 '08 at 16:09
  • I missed the Linux factor, fair enough. Version control works the same regardless of the programming language. There's no special client for PHP vs. Python so that's a moot point. In any case, subversion is a good choice as it's easy to setup and easy to use. As he's on Linux, the "svn" binary is all he needs. Thanks for voting me down. – Bil Simser Aug 21 '10 at 02:44