I want to setup a test server, where I build/test the site and have it version controlled with SVN, then when ready push it to the production server. Make this a part of my daily workflow.
OK, I have never used a test server before. I have always just edited file right on the production server. I have never used any type of version control before. I have no experience on a Linux machine, and no shell scripting experience. I also have no higher programmers where I work who can help with this either.
This is very hard because I am trying to learn multiple things, SVN, BASH, on a an operating system I have no experience with. I follow tutorials but when something goes wrong I get very confused because I don’t know if I its a problem related to linux, or my bash is wrong or I made an SVN mistake.
Whats the best steps to gain all the necessary knowledge without going crazy in the process?
For setting up SVN on windows, check out visual SVN server. It is the only way to fly.
You also might want to look to look at employing a continuous integration server to manage the build/deployment process. A few good examples are jetbrains teamcity or cruisecontrol.net.
You don’t know how often I’ve dealt with servers where everything is “live” and they didn’t bother to set up so much as groups, everyone signs in with the same userid… seems simple at first, but makes a huge mess.
I’d say get to know the individual components first. Play around with svn outside of your web stuff. Then play around with your shell, then futs with apache until you get an idea of what system is what. It won’t take very long and you’ll be able to separate the parts.
Most problems you’ll encounter will be in your development area, in particular, pathnames and database access being different than your production server. (I use environment variables to deal with this)
Personally, I use 3 “logical” servers, freebsd for live, linux for devel and freebsd for a CVS repository.
The CVS repository as a 3rd machine helps keep things synchronized, sounds complicated but it really does make it more simple. I find it really helps to think of SVN (or CVS or whatever…) as a kind of “database” for your code.
Also, I don’t “push” changes to the live site, I “pull” changes. In my setup, the website is just another cvs user. (in your case, svn).
Most of my actual “work” is done on the linux machine, running apache I do my edits there.
When things are as I want them to be, I go to the live system and do an update. (you might have to adjust your firewall for this to work)
This way, the website is more or less another user, just like myself and if I absolutely need to, I can do “live” edits, commit back to the cvs server and have the changes reflect back to my development environment.
It works amazingly well and I highly recommend using a separate revision control system.
As far as the shell, you should spend some time messing with it, as it’ll save you a LOT of time when you learn some of the tricks it has to offer. I recommend “UNIX powertools” by O’Reilly. (it’s actually a fun read!)
The shell IMO, offers the most fun you can have on a unix box
I’ve tried the windows stuff for SVN (different project), it seemed to make things too confusing, I appreciate being able to see what it’s doing.
You probably won’t need much Bash to start with - so I wouldn’t worry about that.
To keep things quite simple when it comes to Linux, I’d suggest maybe trying to isntall something like a Ubuntu Server on a spare PC you have, getting used to the command line and how to install and configure things (where configs live) - there is a lot of help and tutorials around releating to Ubuntu for both servers and desktops.
From there you should be able to find something to help you get a subversion server setup and then its a case of a client on the desktop and away you go, editing and “commiting” when you’ve made a suitable set of changes.