Do you have a local testing environment?

  • Yes

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%
  • No comment

    Votes: 0 0.0%

  • Total voters
    0
Status
Not open for further replies.

daviddoran

New Member
Sparks, is Subversion useful for managing PHP projects?
I have always just edited the files and occasionally saved back-ups but I'd like to move away from that and have better versioning, would this be productive and easy enough to set up with subversion?
 

7aken

New Member
desktop
Apache 2.2.2, MySQL 5.0.22, PHP 5.1.4 on xp pro

laptop (windows partition)
wampserver xp pro
on linux (mandriva) partition i use lamp
 

Sparks

New Member
david, it's what we use here for PHP projects.
And it's what I use to keep my firefox bookmarks synced between machines, and as a /skeleton for my .cshrc and such files between different machines, and what I store my PhD thesis in, and where I'm doing the development of my hobby projects, and...
:D I think that makes the point :D


Yes, for what you're talking about, it's fine.
It works best if there's a server that you can run the subversion daemon on, especially if there's more than one of you working, but even if it's just local, it's still good. There's also a win32 svn client called TortiseSVN that's free and well-integrated, that's what I use on the win32 machines I have to use.
 

daviddoran

New Member
Thanks Sparks, I spent a while yesterday and now have a local subversion and TortoiseSVN which seem to be working very nicely.

Though I actually find command line easier alot of the time, as I imagine alot of peope do.
 

Sidane

New Member
Run all my sites locally for development/testing then upload to a staging server for client review and approval. Then deploy to the live server.

Local environment:
OS X / Apache 1.3 / PHP / MySQL / Ruby on Rails etc

Have been playing with Capistrano of late and it really makes deployment a sinch. Nifty little program.

Version control is an absolute must imo.

I've got subversion running off a crappy old 486 in my apartment, using my NTL connection and dyndns.org :) Not exactly the most elegant solution but means I can access all my files from anywhere with the various machines I use - be I in the office, at home, on the road - and all files are in sync.

I'm using SmartSVN for a GUI client.
 

enzo

New Member
Just a question for you ... how secure is this? :confused:

I managed to set up it, although I had to do some pricking around with host files etc, so now the address resolves to my apache install homepage. What are the chances of someone being able to gain access to other areas of my PC?? (newbie question I know!)

Also, do you know if it's possible to get the url to resolve to a specific folder without changing the apache document root? (i'd still like to be able to access my apache homepage via //localhost for example)
 

Sidane

New Member
Hi Enzo,
Well it will be as secure or insecure as your apache configuration :)

If you haven't already, at the very least you'll want to password protect your repository - I'm using basic authentication which is sufficient for my needs, but you could go further and look into using SSL if you want to encrypt the connection.

Regarding using a specific subdirectory for your repository, while keeping your default apache homepage, I have the following location configuration in my apache config.

<Location /svn>
DAV svn
SVNPath /path/to/your/repository/
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /path/to/your/password/file
Require valid-user
</Location>

So I access my repository from http://my.site.address/svn/
Note that that location configuration includes basic authentication. It's the first two lines that set the url to your repository.

Hope that helps.
 

enzo

New Member
Well it will be as secure or insecure as your apache configuration :)

Ah, so not so secure so :)

If you haven't already, at the very least you'll want to password protect your repository

Yeah, just basic htaccess auth aughta do.

Regarding using a specific subdirectory for your repository, while keeping your default apache homepage, I have the following location configuration in my apache config.

Excellent, thanks Sidane!
 

webdream

New Member
After many years of developing on a local server, I now just use this as a backup mechanism more than anything.

I'll always develop on the live server these days (in a test dir.), and usualy update sites on the live site version.

The change came for me with the great ftp integration in homesite 5 , just makes life a whole lot easier. And whatever you may think, there are always some config. differences between a local and deployment server which can be a pain when you find your code doesn't quite work when you deploy.

I would now only use a local server (on my lappy) in an emergency sittuation when mobile and no access to broadband (touch wood that never happens!)
 

daviddoran

New Member
Sparks is saying (as I would) that it is madness to work off a Live server.
My editor does FTP files back up to the server like Homesite does when I save them but I only do this in situations where I want to quickly edit a concept on the server, not while working on a real project.

Maybe it works for you but I think that there is much more productivity and reliability working on localhost.
 

webdream

New Member
yeah, i guess it depends on how you like to work. Personaly, i find it just as easy to open a file and edit on the live server.

In the end it doesn't make much odds if your dev. server is based in your office or the Data Center realy... it's still just a network.

I thought maybe Sparks meant it was dangerous somehow, besides that 'each to their own' I guess.
 

Sparks

New Member
It is dangerous wd. Is it easy to open a file and edit on the live server? Of course it is. What happens if there's a power failure on your end as you do so? Or some other hardware failure? Or a network connectivity problem? What happens if you're tired and just accidentally thrash the file? What if there are two people working on two seperate problems in the one file, and A starts work, then B starts work, then B finishes and saves and then A finishes and saves? Or if the sequence runs A-B-A-B? And what if someone tries to use the site as you're editing it? What if the hard disk on the live server gets thrashed? What if there's a fire in the server farm and you lose the whole box? What if A and B both put up changes successfully and something breaks and you need to know who worked on what and when to help diagnose the problem? Where's your audit trail?

Simply put, too much can go wrong, and with every edit, you're putting live an untested change. End result, client thinks you're a cowboy because you're acting like one, they pull their business out and go elsewhere, and now what do you do?
 

webdream

New Member
thanxs for responding Sparks.

Firstly, I would like to point out that there is a difference between a live website and the live server. For development work etc. we would not be working on the 'live site' instead we setup a development version and work on this environment.

1.
What happens if there's a power failure on your end as you do so? Or some other hardware failure? Or a network connectivity problem?
What happens if you're tired and just accidentally thrash the file?

For us that would probally have greater impact if we only used a local test environment, as we have automated backup scripts in place on the live server which mirror rolling backups to a second machine in the server farm. So, in the event that we seriously lost some work through one of the events you mention we could i fact retrieve previous versions. This has not happened to date. I would also point out that we do in fact keep local backups too of all live sites and dev. work.

2.
What if there are two people working on two seperate problems in the one file, and A starts work, then B starts work, then B finishes and saves and then A finishes and saves? Or if the sequence runs A-B-A-B?

Normal version control procedures apply. There is realy no difference here between a localy or remotly hosted version.

3.
And what if someone tries to use the site as you're editing it?

We wouldn't be editing a live website that uses any sort of form post or anything else that may endanger the application.

4.
What if the hard disk on the live server gets thrashed? What if there's a fire in the server farm and you lose the whole box?

There is a far greater chance of this occuring with a local server than a machine in the data center. If we did have a fatal event with our live server our backup box would kick in with a maximum down time of 3 hours.

5.
End result, client thinks you're a cowboy because you're acting like one

no Sparks, anything but...

At the end of the day I am not trying to persuade anyone to change their own working methods, it is entirly up to you to do as you feel best.

For us this system works very well in terms of version control, security and risk management. Another benefit for us is that our clients are able to review work in progress and participate in the dev. process.

Again it depends on how you work. I personaly work on contract at several different locations when I am in Ireland. I also work abroad a lot (8 times last year). It would be far harder for me to carry all client sites on my laptop or whatever. At the end of the day the machines in the server center are always available for me wherever I am, so I find this very convienient.

best regards, webdream
 
Status
Not open for further replies.
Top