• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Development => Production Server Deployment

Drbeagle

Limp Gawd
Joined
Feb 9, 2003
Messages
375
I recently took over doing some web maintainance and development for my on-campus job. The previous folks had not used a development box and instead did all their development on the production server. Obviously, this is bad practice and did, in fact, lead to several production server crashes and outages.

I've now got a development server running. However, I'm wondering how to go about deploying files from development to production. What little background I have with this sort of environment was with J2EE, but all this work is in PHP. With J2EE, everything has to be packaged up and then loaded by the J2EE container. Thus, it's fairly easy to deploy the updated package (and it easy to automate using something like Ant).

I'm looking for a way to deploy PHP pages in such a simple manner. Is something of the sort available or is my best bet just creating my own script to transfer files?
 
I set up a subversion server and do all my of dev on my local machine with a local php/mysql/apache install. Then as I commit changes to the subversion repository I update a development testing server that I run all my tests on. If it passes I then perform a subversion update on a checked out copy of the repository on the live server. With this in place I haven't had any issues because most of the problems with different mysql/php versions between my development laptop and the server are discovered on the testing server.

Just make sure your testing (or in your case developement) server is as close in package versions and everything to the live server as possible.
 
I just saw this link in another thread Converting Your Website to Subversion .

I have not had a chance to try it but I have the need. I am past the point that I cannot code on the production server because too many people use it. I am getting tired of waiting until after hours to work on my changes.

deuce868, was this hard to implement? Did you convert a live site or were you able to start from scratch?
 
Hmmm, how did I set it up. It was a few years ago. I first created the subversion repository on one of my linux servers and created the user accounts for access. Then from my development machine I took my folder of files for the site and added them as revision #1. I committed those new files to the repository. Then on the live server I checked out this new repository to /var/www/live/. Once it was done I changed the httpd.conf file to use /var/www/live as the docroot instead of just /var/www. This way there was no downtime between the "old" and "new".

Once you get that working you can remove all of your old files from the /var/www (except the live folder of course). From then on you work on your dev machine, commit the changes, and then on the live server just perform a svn update to get the new files.

Just make sure that as you commit you only perform updates once you have a solid fully functional version. You can only update specific files and such, but it gets to be a mess to manage quickly that way.
 
This method sounds great. Thanks for the replies.

Unfortunately for me, I won't be able to get either a subversion license up or have the ability to check out revisions on the production server. Trying to institute 'best practices' in my school's IT organization (while I'm just a student working parttime) is like pushing a loaded semi up Mt. Everest.

Once again, thanks for the great replies.
 
Well maybe the better thing to do is figure out what you do have available though. Is subversion out because you don't have access on the server to install it? It's open source so licenses shouldn't be an issue.

If it's a matter of access, what do you have? Ftp, ssh, etc?
 
It's mainly a matter of what the server admin is willing to support at this time. I can install subversion on local box, but then it won't have data backups or anything like that.

I'm definately going to ask the server admin about going to a method like this, but I have a feeling I'll be graduated before it could really be implemented properly.

I'm pretty sure alot of these "servers" started as desktops running Windows Server XXXX and are just now being migrated to a true servers with RAID and other features designed to minimize loss of data and downtime.

The web stuff I'm doing is only for internal use for a small organization, so our web development needs (especially wants) are not high priorities.
 
deuce868 said:
Well maybe the better thing to do is figure out what you do have available though. Is subversion out because you don't have access on the server to install it? It's open source so licenses shouldn't be an issue.

If it's a matter of access, what do you have? Ftp, ssh, etc?

As far as access, it's a windows server so I've got network access to our folder on the server. Right now, I just copy and paste changed files from development to production.
 
Back
Top