I have a ubuntu machine I have setup. I installed apache2 and php5 on it. I can access the web server from other machines on the network via http://linux-server. I have subversion installed on it. I also have vsftpd installed on it so I can ftp to it from another computer on the network.
Myself and other users currently use dreamweaver to checkin-checkout files directly from our live site to make changes.
I want the connect to the linux server from pc. make the changes on the test server until ready and then pushed to the live site. I want to use subversion also into this workflow as well. but not sure what the best workflow is or how to set this up.
I have no experience with linux, svn, or even using a test server, the checkin/out we are currently doing is the way I have always done it.
I have hit many snags already just getting what I have setup because of my lack of knowledge in the area. Dreamweaver 5 has integration with subversion but I can't figure out how to get it to work.
I want to setup and create the best workflow possible.
I dont expect anyone to be able to give me an answer that will enlighten me enough to know everthing I need to know to do what I want to do (altough if possible that would be great) instead I am looking for maybe a knowledge path like answer. Like a general outline of what I need to do accompanied with links to learn how to do it. like read this book to learn linux, then read this article to learn svn, etc., then you should know what to do. I would be happy just getting it all setup, but I would like to know what I am actually doing while setting it up too.
I'm sure you've solved your issue by now, but for future reference to other users, here's the steps I would suggest to get started:
Create a repository for your project (in Ubuntu)
Host the SVN repo using Apache
I'd read up on the subversion book to look at some strategies for development with SVN.
To connect to your SVN machine, you'll need to use it's IP or hostname instead of your svn live site you mentioned. With proper forwarding, it's easy to access it from anywhere.
Related
I have created a simple web-application using PHP, JS etc.. My next step is to deploy it to eg. liveserver.com. I am sure that I will be providing a lot of additional features in the future and so I would like to know how this is generally done. I am pretty sure its a noob question so I tried to google it but nothing helpful came up.
Here is a rough idea on how I may do it. I would keep a local copy in WAMP and keep developing it and sync / push it to bitbucket. The question is : How do I connect the updated bitbucket version to my liveserver.com. I am keen to know how web-developers generally provide updates to their app users. Is there a general update mechanism they follow ? Is my idea of using a version control application wrong for this purpose ? How would you do it for a simple app like this ?
A concise answer would suffice. It would be great if anyone could provide me helpful links or point me to right direction, further information etc. TIA.
You're really asking two questions here:
How do I connect the updated bitbucket version to my liveserver.com?
I would like to know how this (syncing code between test environment and production environment) is generally done, best practices and stuff.
The first question is answered here. The latter, broader question is touched on here but I'd like to offer my personal thoughts as well.
You've mentioned you're using WAMP, whereas I'm coming from a LAMP environment. Regardless, I'm hoping you will find some additional usefulness in my answer as it may help lead you to a Windows-based equivalent solution.
At home/work:
I also use bitbucket and prefer it to github. I have Git installed for source control which allows me to push or pull any code between bitbucket and my local machine.
On the go:
I have AWD IDE installed on my tablet which allows me FTP access to a production environment, and the non-free version also has Git integration. Another great IDE is Cloud 9; completely web-based and convenient if I don't have my tablet with me and need to use a public computer or laptop. Cloud 9 also supports Git.
Syncing:
Rather than push code from Bitbucket to my production server, I prefer to keep a mirror of my production server locally. I use a tool called rsync for this. I have a bash file setup on a cron job that looks something like this:
#!/bin/sh
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
RUSER=remoteUser
RHOST=remoteHost
RPATH=/remote/path/
LPATH=/local/path/mirror/
$RSYNC -av --no-p --delete -O -e $SSH $RUSER#$RHOST:$RPATH $LPATH
So basically, my primary workstation (which is where I do most of my work) is always in sync with the live server. Both the live server and Bitbucket can be updated away from home. Thanks to Git, I can see exactly what has been modified. It's also comforting to know my code exists in three different places for redundancy.
This is what I have found to be most convenient for me, but I would love to know how others do it.
At the moment I am using poor method to work at home and at work to do web development.
I use Wamp for testing/development and then I upload to a production web server (Linux) via FTP.
If I continue with the project at home, I have to download the files from FTP.
What is good method to work on same projects at multiple locations?
Someone suggest me to learn Git and get Github private account. Also suggested to get Vagrant installed at work and home. Do I need to install Git in Vagrant VM or local machine?
Learn git: http://try.github.io
Create a Vagrant/VrtualBox VM by following the directions at https://puphpet.com
One of the tricks here is to put the Vagrant stuff you get from Puphpet directly in your project and then commit all of it to git. You'll then be able to check out the project in a new environment and, as long as Vagrant and VirtualBox are installed, you can run vagrant up and be working in about 5 mins.
Here's an example of how I'm doing just that to allow people to easily try out a library I've written: https://github.com/jeremykendall/query-auth-impl.
Enjoy! Your life as a developer is about to get a lot easier and a whole lot better.
Github or Bitbucket. Git or Mercurial, and also Svn if it's just for yourself and you want an easier learning curve.
Any source control system would be ideal for this.
You don't want your production server to be the source of truth for the actual code. Those two concerns should definitely be separated. The production application is the output of the code, not the code itself. For a language like PHP the two may be identical, but the concerns themselves should still be separated. Indeed, for small systems the two services may even be hosted on the same server, but should still be logically separated.
The source control system maintains the changes made to the code over time, the production server is a snapshot of the current release version of the code.
I am an avid webdev hobbyist and freelance, up until now I simply edit the website live (put a maintenance message up while its being made), now all my projects up until now have also been very small.
eg I make a site, show em, take money and go, I've never had to work on a site after it's gone live.
Now my new project is pretty big and I know I will have to edit it after its gone live and maybe have a small team of devs (atm just me)
So how do people professionally handle this? I know I will need a prefix-amp app cos i run an apache server, I've also heared that people use github for versioning, but I'm not really sure because apparently its not svn?
Thanks
ps. I have a windows 7 pc, so no mac apps please
up until now i simply edit the website live
Terrible in my book ;)
so how do people professionally handle this?
First you need to setup a development server (it would be best to keep it as close as possible to the expected live environments). On this server you would install all the software you need.
You may also want to setup a staging server.
i know i will need a prefix-amp app
I hope you are not talking about those one click installers. If you would do it professionally you should install everything yourself that way you can set it up the way you need it.
ive also heared that people use github for versioning, but im not really sure because apparently its not svn?
GitHub is just a website. What you are looking for is git or svn for versioning. You could also setup a git or svn server locally instead of using services like GitHub. Basically what versioning is is that when somebody makes a change to the code he/she would need commit the changes. This way it is easy to keep track of changes in the codebase (like what was changed, when was it changed and by whom).
Local XAMP-stack (LAMP, or WAMP) for development
intranet-system for test and maybe staging
Of course the live system
Versioncontrol, I prefer git. Of course you can use SVN too, but... lets say: It's SVN.
Make changes local, test this changes local
everythings fine: Push it into the "master" vcs-repository
New version ready (or it's "sunday-night-release-time")? Push all that stuff on test/stage
Everythings fine there too: Push it into the live system
Thats very shortened of course, but it should give you an idea.
The tool where you manage your software version is not that important. Use Git, or SVN or whatever, the one you like most. But use _one_.
Equally important is that you run the "page" on two sites, a test and a live system, strictly apart. Both systems have to be very close in their layout, all changes must first be done in the test system, be verified and then done in the same manner in the live system. Do not allow changes only to be made to the live system ('cause it's just a small change'). No exceptions.
Then think about deployment: how will you transfer changed files to the target system ? You need routines for this, that run once started and don't forget a step in between.
Firstly you need some kind of versioning system: either SVN or Git. GitHub is simply an online service that provides managed Git repositories. Secondly you need a development server.
If it were just you doing development, you could host both of these on your local desktop PC, but since other developers are going to be joining, you need a remote server. If you don't want to be running a server out of your home, the best option is a VPS (virtual private server) on which you can install Git, Apache, etc. and anything else you need.
As for development software, take your pick- there are loads of options. A common choice is the NetBeans IDE and TortoiseGit combo. You use NetBeans to develop your code on, automatically uploading to your development server, then you TortoiseGit to commit and sync changes.
Only when you're ready to go live do you copy the code from the dev server to the production server.
I am new to this, I just reading about how I should not edit code on the live production server. I don't know anything about source control or SVN.
I would like to start coding on a test server then once everything is confirmed working, I want to send all the files over to the production server.
How should I go about this? I am on mac os x and was looking into apps like http://versionsapp.com/ but I am not sure if this is the right solution.
What do you suggest?
If you are new to web development, I wouldn't suggest jumping into Subversion right away. You should have a firm grasp on Subversion before actually using it in any production environment, as its surprisingly easy to screw things up. Don't let that scare you off, though, as version management (whether through SVN or another avenue) is highly useful.
And if the project in question is small enough, I don't see anything wrong with the old "develop locally then ftp it to the server" approach. Sometimes a full-blown version management tool just isn't necessary.
Whether or not a SVN deployment strategy is appropriate depends on factors such as the size of the site, your familiarity with using the command line, and whether you are working as part of a team.
It is worth noting that in most shared hosting environments you won't have the option to install SVN on the server, which narrows your options somewhat!
I don't think there is anything inherently bad about using good old fashioned FTP to get files up to a server, especially for smaller sites where you are the only person working on the site.
Even then, SVN can still be very useful. I keep all my sites under version control even if they are going to be deployed by FTP.
Just go with SVN as it is the basics. After you get a taste of it you can explore the alternatives like GIT or whatever.
You should learn to do the basic SVN stuff through the console, there is no other way especially if you are going to work on a live server. Your live server should have SVN installed and some SSH access so you can execute your SVN command there.
You can also get TortoiseSVN which is a nice visual client for SVN.
The basic SVN you are going to use is those 3 commands:
$ svn co # Checkout
$ svn ci # Commit
$ svn up # Update
There are tons of tutorials of how to do stuff, here is the first one from google:
http://paulstamatiou.com/how-to-subversion-basics
After you feel comfortable with that stuff and when you start working with team and contribute to public repositories you might start exploring the advanced stuff like branches, tags and all other terms that make some people feel important when they mention them.
This versionwhatever.com I would hold for now and explore the popular choices, before specializing, especially that SVN works on UNIX and you can put it on Linux which runs most of the web hosting out there.
Cheers!
If you're just starting out I recommend you avoid SVN. Try git, there are numerous mac tools, such as GitX for Mac. There's also github and others to host your projects for easy pulling and revisions within a group of people.
So we are pushing to create good processes in our office. I work in a web shop that has been doing web sites for over a decade. And we don't use version control. I know! It's bad, not my fault. I'm the guy with a SoftE background pushing for this at a minimum.
The tech lead has been looking into it. We all use Mac workstations and mostly use Coda for editing since it is a great IDE. It has SVN support built in but expects it to work on local files. We're trying to explore mounting the web directory as a local network drive with an SFTP tool.
We are a LAMP shop, BTW.
I am wondering what the model is here. I think we have typically would checkout the whole site to our local machine where we have apache running and then test it there? This isn't how we work yet, we do everything on the server. We've looked at checking things in and out, but some files are owned by apache and the ownerships change when I check them in, because I'm not apache.
I just want to know a way to do this that works given my circumstances. Would be nice to not have to run apache locally.
You might want to checkout the Coda mailing list and ask there. Lots of Coda enthusiasts there with specific experience.
If you don't want to have to run locally could make Apache on your server run a copy of the site for every developer, on a different port per person, and then mount those web-roots to the local macs and make that the working directory. If you're a small shop that's not hard to manage. I find that pretty easy to set up and saves a lot of resources on the local machines. The one-site-per-person helps to avoid conflicts with multiple people working on files at the same time.
What I'd additionally recommend is to have a script that gets the latest changes from SVN and deploys the entire site to the production server when you're ready. You could have that script change permissions on appropriate files/folders as needed to be owned by Apache. The idea once you're using source control is to never manually edit the production files -- you should have something that deploys it from SVN for you.
A few notes:
Take a look at MacFuse / MacFusion (the latter is the application, the former is the library behind it) to mount remote directories via SSH / FTP as local ones.
Allow your developers to check out into their local environment (with their own LAMP stack if they're savvy), or look into a shared dev environment with individual jails. This way your developers can run their own LAMP stack (which you could deploy for them on the machine) without interfering with others.
The idea being, let them use a workflow that works best for them, to minimize the pain in adapting to this change (if change management might be an issue!)
Just as an example, we have a shared dev server where jails are created with a single command for new developers. They have a full LAMP stack ready to go, and we can upgrade and re-deploy jails easily to keep software up to date. Developers have individual control to add custom settings / extensions if they need it for work, while the sys admins have the ability to reset everything when someone accidently breaks their environment :)
Those who prefer not to use jails, and are able to, manage their own local environments (typically through Macports or MAMP).