Discussion:
[nycphp-talk] Deploying PHP Applications
(too old to reply)
Jeremy Hise
2010-04-29 17:28:25 UTC
Permalink
Hiya,

So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?

Thanks!

jeremy
Jason Salsiccia
2010-04-29 17:35:37 UTC
Permalink
Here's how I to do it.

As you said, have a subversion client installed on the server running your
web host. If your doc root is /var/www/html, have html be a symlink to
current code.

/var/www/html -> /var/www/tag_XXXX

The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. The last thing the build script does is switch
the html symlink from the old tag to the new tag to make the deployment
live.

Jason
Post by Jeremy Hise
Hiya,
So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?
Thanks!
jeremy
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100429/c2b48dee/attachment.html>
Jeremy Hise
2010-04-29 17:39:59 UTC
Permalink
Ok so it's not crazy to put an svn client on a production server for this
purpose.

Thanks for the tip!
Post by Jason Salsiccia
Here's how I to do it.
As you said, have a subversion client installed on the server running your
web host. If your doc root is /var/www/html, have html be a symlink to
current code.
/var/www/html -> /var/www/tag_XXXX
The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. The last thing the build script does is switch
the html symlink from the old tag to the new tag to make the deployment
live.
Jason
Post by Jeremy Hise
Hiya,
So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?
Thanks!
jeremy
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Jeremy Hise
Application Developer

ledCity.net
Jason Salsiccia
2010-04-29 17:44:15 UTC
Permalink
I don't see any reason not to. If you would prefer, you could run the
checkout from any server and FTP / SSH the files up to production in the
build script. Thats actually the better way to go when you have multiple
web servers. That way can have one build script handle all of them instead
of executing a separate deployment on each server.

Jason
Post by Jeremy Hise
Ok so it's not crazy to put an svn client on a production server for this
purpose.
Thanks for the tip!
Post by Jason Salsiccia
Here's how I to do it.
As you said, have a subversion client installed on the server running
your
Post by Jason Salsiccia
web host. If your doc root is /var/www/html, have html be a symlink to
current code.
/var/www/html -> /var/www/tag_XXXX
The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. The last thing the build script does is switch
the html symlink from the old tag to the new tag to make the deployment
live.
Jason
Post by Jeremy Hise
Hiya,
So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?
Thanks!
jeremy
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Jeremy Hise
Application Developer
ledCity.net
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100429/9df4baca/attachment.html>
Matt Juszczak
2010-04-29 17:49:38 UTC
Permalink
If you're doing tags, I would recommend an svn export vs. an svn checkout.

Branches, use svn checkout (so you can svn up)

-Matt
I don't see any reason not to.??? If you would prefer, you could run the checkout from any server and FTP / SSH the files
up to production in the build script.?? Thats actually the better way to go when you have multiple web servers.?? That
way can have one build script handle all of them instead of executing a separate deployment on each server.
Jason
Ok so it's not crazy to put an svn client on a production server for this
purpose.
Thanks for the tip!
Post by Jason Salsiccia
Here's how I to do it.
As you said, have a subversion client installed on the server running your
web host. ? If your doc root is /var/www/html, ?have html be a symlink to
current code.
/var/www/html -> /var/www/tag_XXXX
The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. ? The last thing the build script does is switch
the html symlink from the old tag to the new tag to make the deployment
live.
Jason
Post by Jeremy Hise
Hiya,
So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?
Thanks!
jeremy
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Jeremy Hise
Application Developer
ledCity.net
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Paul A Houle
2010-04-29 17:52:02 UTC
Permalink
Post by Jeremy Hise
Ok so it's not crazy to put an svn client on a production server for this
purpose.
Thanks for the tip!
Although it drives certain IT people bonkers, I think it's a very
wise thing to put a version control client on your server.

I would have a problem with letting it be CVS--, I mean "svn".

Although "svn" superficially improves on CVS in some ways, my
experience is that the CVS branching model is a perfect match for the
challenges that I've faced in developing web systems that evolve. That
branching model can be emulated easily in git, and that's what I use today.
Max Gribov
2010-04-29 17:50:38 UTC
Permalink
Post by Jason Salsiccia
Here's how I to do it.
As you said, have a subversion client installed on the server running
your web host. If your doc root is /var/www/html, have html be a
symlink to current code.
/var/www/html -> /var/www/tag_XXXX
and you can also svn export to an nfs share, and then rsync from there
to multiple machines if you want.
the rsync and any other tasks can be done by a deploy script.
using that tag method you can also automate changelog through svn log.
you'd have to have the tag revision numbers.
Post by Jason Salsiccia
The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. The last thing the build script does is
switch the html symlink from the old tag to the new tag to make the
deployment live.
Jason
On Thu, Apr 29, 2010 at 1:28 PM, Jeremy Hise <jhise at ledcity.net
Hiya,
So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?
Thanks!
jeremy
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100429/30f5a1bb/attachment.html>
Anthony Papillion
2010-04-29 17:55:38 UTC
Permalink
So I'm a bit curious and perhaps I'm missing the point here (probably am)
but why go through all this hassle? Why not just do a straight FTP of the
files from the staging machine to the deployment machine? Does using
checkin/check out benefit us in some way besides the original file integrity
and management?



Anthony Papillion





From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Max Gribov
Sent: Thursday, April 29, 2010 12:51 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Deploying PHP Applications



On 04/29/2010 01:35 PM, Jason Salsiccia wrote:

Here's how I to do it.

As you said, have a subversion client installed on the server running your
web host. If your doc root is /var/www/html, have html be a symlink to
current code.

/var/www/html -> /var/www/tag_XXXX


and you can also svn export to an nfs share, and then rsync from there to
multiple machines if you want.
the rsync and any other tasks can be done by a deploy script.
using that tag method you can also automate changelog through svn log. you'd
have to have the tag revision numbers.





The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. The last thing the build script does is switch
the html symlink from the old tag to the new tag to make the deployment
live.

Jason

On Thu, Apr 29, 2010 at 1:28 PM, Jeremy Hise <jhise at ledcity.net> wrote:

Hiya,

So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?

Thanks!

jeremy

_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation







_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100429/e378f5c7/attachment.html>
Jeremy Hise
2010-04-29 18:12:10 UTC
Permalink
Well, FTP is a fine option I think, but this deployment strategy I'm
trying to work into cruisecontrol.rb. My ultimate goal is to go to the
cruise control interface, click a button. Make sure my php unit tests
work, make sure php lint doesn't complain and on success, push up the
latest release tag to a production server. This would also allow me to
deploy to QA servers for the testers. Config files and files generated by
the application would need to remain in place.
Post by Anthony Papillion
So I'm a bit curious and perhaps I'm missing the point here (probably am)
but why go through all this hassle? Why not just do a straight FTP of the
files from the staging machine to the deployment machine? Does using
checkin/check out benefit us in some way besides the original file integrity
and management?
Anthony Papillion
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Max Gribov
Sent: Thursday, April 29, 2010 12:51 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Deploying PHP Applications
Here's how I to do it.
As you said, have a subversion client installed on the server running your
web host. If your doc root is /var/www/html, have html be a symlink to
current code.
/var/www/html -> /var/www/tag_XXXX
and you can also svn export to an nfs share, and then rsync from there to
multiple machines if you want.
the rsync and any other tasks can be done by a deploy script.
using that tag method you can also automate changelog through svn log. you'd
have to have the tag revision numbers.
The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. The last thing the build script does is switch
the html symlink from the old tag to the new tag to make the deployment
live.
Jason
Hiya,
So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?
Thanks!
jeremy
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Jeremy Hise
Application Developer

ledCity.net
Anthony Papillion
2010-04-29 18:24:32 UTC
Permalink
Ahh, I get it. Makes much more sense.
Thanks!


-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Jeremy Hise
Sent: Thursday, April 29, 2010 1:12 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Deploying PHP Applications

Well, FTP is a fine option I think, but this deployment strategy I'm
trying to work into cruisecontrol.rb. My ultimate goal is to go to the
cruise control interface, click a button. Make sure my php unit tests
work, make sure php lint doesn't complain and on success, push up the
latest release tag to a production server. This would also allow me to
deploy to QA servers for the testers. Config files and files generated by
the application would need to remain in place.
Post by Anthony Papillion
So I'm a bit curious and perhaps I'm missing the point here (probably am)
but why go through all this hassle? Why not just do a straight FTP of the
files from the staging machine to the deployment machine? Does using
checkin/check out benefit us in some way besides the original file integrity
and management?
Anthony Papillion
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Max Gribov
Sent: Thursday, April 29, 2010 12:51 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Deploying PHP Applications
Here's how I to do it.
As you said, have a subversion client installed on the server running your
web host. If your doc root is /var/www/html, have html be a symlink to
current code.
/var/www/html -> /var/www/tag_XXXX
and you can also svn export to an nfs share, and then rsync from there to
multiple machines if you want.
the rsync and any other tasks can be done by a deploy script.
using that tag method you can also automate changelog through svn log. you'd
have to have the tag revision numbers.
The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. The last thing the build script does is switch
the html symlink from the old tag to the new tag to make the deployment
live.
Jason
Hiya,
So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?
Thanks!
jeremy
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Jeremy Hise
Application Developer

ledCity.net

_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation
Jeremy Hise
2010-04-29 18:29:14 UTC
Permalink
Thanks everyone.
Post by Anthony Papillion
Ahh, I get it. Makes much more sense.
Thanks!
-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Jeremy Hise
Sent: Thursday, April 29, 2010 1:12 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Deploying PHP Applications
Well, FTP is a fine option I think, but this deployment strategy I'm
trying to work into cruisecontrol.rb. My ultimate goal is to go to the
cruise control interface, click a button. Make sure my php unit tests
work, make sure php lint doesn't complain and on success, push up the
latest release tag to a production server. This would also allow me to
deploy to QA servers for the testers. Config files and files generated by
the application would need to remain in place.
Post by Anthony Papillion
So I'm a bit curious and perhaps I'm missing the point here (probably am)
but why go through all this hassle? Why not just do a straight FTP of the
files from the staging machine to the deployment machine? Does using
checkin/check out benefit us in some way besides the original file integrity
and management?
Anthony Papillion
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Max Gribov
Sent: Thursday, April 29, 2010 12:51 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Deploying PHP Applications
Here's how I to do it.
As you said, have a subversion client installed on the server running your
web host. If your doc root is /var/www/html, have html be a symlink to
current code.
/var/www/html -> /var/www/tag_XXXX
and you can also svn export to an nfs share, and then rsync from there to
multiple machines if you want.
the rsync and any other tasks can be done by a deploy script.
using that tag method you can also automate changelog through svn log. you'd
have to have the tag revision numbers.
The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. The last thing the build script does is switch
the html symlink from the old tag to the new tag to make the deployment
live.
Jason
Hiya,
So I've recently been put in charge of a tech department at my company.
One issue that we are trying to get a handle on is a good way to get our
PHP applications from a development/staging environment to a production
server. The production servers are accessible via ssh/ftp/etc. One quick
thought would be to install a subversion client on the server and have
that export the application to a spot where a build script could then set
it up. However, is there a "best-practices" way of doing this?
Thanks!
jeremy
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Jeremy Hise
Application Developer
ledCity.net
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Jeremy Hise
Application Developer

ledCity.net
Chris Snyder
2010-04-29 19:09:11 UTC
Permalink
So I?m a bit curious and perhaps I?m missing the point here (probably am)
but why go through all this hassle? Why not just do a straight FTP of the
files from the staging machine to the deployment machine?? Does using
checkin/check out benefit us in some way besides the original file integrity
and management?
FTP (uh, SFTP) forces you to upload the entire codebase or
pick-and-choose the files that changed. svn up just gets the changes.

Source control also gives you a quick and easy rollback when you
realize that one of the new files just borked your production site.
Anthony Wlodarski
2010-04-29 19:51:19 UTC
Permalink
I additionally preferred the SVN checkout procedure to make the production environment a local working copy that could be used with "svn up". One thing I had to do was make sure that none of the SVN files were accessible via the web. You can throw the following code into a .htaccess file if you don't have access to the .conf files.

<IfModule mod_rewrite.c>
RewriteRule ^(.*/)?\.svn/ - [F,L]
ErrorDocument 403 "Access Forbidden"
</IfModule>

You just never know what someone could do with access to those .svn directories.

Anthony W.
oneofthosed3afmutes at yahoo.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100429/a0af0797/attachment.html>
Mike Hernandez
2010-04-29 19:58:50 UTC
Permalink
Post by Anthony Wlodarski
I additionally preferred the SVN checkout procedure to make the
production environment a local working copy that could be used with
"svn up". One thing I had to do was make sure that none of the SVN
files were accessible via the web. You can throw the following code
into a .htaccess file if you don't have access to the .conf files.
<IfModule mod_rewrite.c>
RewriteRule ^(.*/)?\.svn/ - [F,L]
ErrorDocument 403 "Access Forbidden"
</IfModule>
You just never know what someone could do with access to those .svn directories.
I've been using svk on my server to mirror the entire repository (which
is kept on a separate server off site). One of the benefits I've
enjoyed thanks to this is that the code tree that's checked out from the
svk repo keeps all of the .svn stuff in my home directory. This way I
can still sync changes but I don't have the svn files in the public tree
at all. I started with svk when I begin using trac, which has nice
subversion integration but wants to have a full repository to work with
(as opposed to a simple checkout of the tree). Svk allows me to mirror
the entire repository on the server, yet still keep the main subversion
repository somewhere else.

--Mike H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100429/26193317/attachment.html>
Paul A Houle
2010-04-29 20:47:01 UTC
Permalink
So I?m a bit curious and perhaps I?m missing the point here (probably
am) but why go through all this hassle? Why not just do a straight FTP
of the files from the staging machine to the deployment machine? Does
using checkin/check out benefit us in some way besides the original
file integrity and management?
Anthony Papillion
Well, FTP has the advantage of inertia. In a lot of IT departments, FTP
is still considered a viable internet protocol, despite numerous
problems: (i) it's over-complicated nature means that FTP clients and
servers tend to be full of security flaws and (ii) it's just not
compatible with the way the internet has worked ever since 1995 or so
(NAT, Firewalls, etc.)

The inventors of 'SFTP' pulled a brilliant marketing coup by
incorporated the three letters 'FTP' into the name of a modern protocol
that has no relationship whatsoever with FTP.

Now, I'm assuming here that we're working in PHP so that there isn't any
compilation, need to kick the server to unload Java classes, etc.
Deployment issues become more complex as you have more artifacts like
that. There's also the issue of how you deploy changes to database
schemas and content.

If a system is busy, for one thing, I'd be concerned that many FTP-based
ways of maintaining the state of a system would leave the files in an
inconsistent state for several seconds to several minutes. There might
be some some software out there that's smarter, but the obvious thing to
do that "always works" is to delete the target directory and re-copy it,
which means the system will be unnecessarily busted for some time. Rsync
does better, but in my experience git, particularly with a local
repository, is incredibly fast.

The big advantage for having your production system be 'checked in' is
that you can make emergency changes directly to the production system,
and then check them back into source control.

You certainly don't want to make changes in your production system on a
daily basis, but I've faced situations, particularly when dealing with
abusive user behavior, a wonky OS on the production machine, or bad
interactions with external automated systems, where a very small patch
to the production system (carefully monitored) is the most effective way
to solve a problem. If your production system is checked in, you can
manage this sort of change very easily -- you can keep track of what was
done, when and be able to check it in or back the change out.

I've got a pretty nice system for website deployment on the server that
serves up

http://ny-pictures.com/

that server isn't heavily loaded yet, so I often run development,
staging and production environments on the same system. I can deploy new
instances of my 'CMS' in less than a minute. The only real trouble I've
got is that I've got some databases that take 30 minutes to mysqldump
these days... Also I am starting to have a number of things that are
"compiled" in my system such as metadata that controls the autoloader,
the data dictionary, and, soon, a cache of commonly autoloaded classes
that will improve the effectiveness of an opcode cache.

Now, if you're working in a clustered environment, where there are
multiple copies of the software pushed out to multiple servers, that's a
whole different game.
Rob Marscher
2010-04-29 17:56:06 UTC
Permalink
If your doc root is /var/www/html, have html be a symlink to current code.
/var/www/html -> /var/www/tag_XXXX
I also use a similar method with symlinks. Sometimes my web server needs a restart for it to recognize the symlink has changed. It might be caused by php realpath caching or maybe there's some type of caching in my Litespeed server or CentOS. I haven't taken the time to really figure it out. At any rate, if you see problems, try restarting your web server and see if that fixes it.

-Rob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100429/c13a7938/attachment.html>
Yitzchak Schaffer
2010-05-02 02:51:40 UTC
Permalink
If your doc root is /var/www/html, have html be a symlink to current code.
/var/www/html -> /var/www/tag_XXXX
Perhaps this is obvious to many here, but I discovered this works
wonders for vendor libraries like symfony - point the app's require
statement to '/usr/local/lib/symfony-1.4', and symlink
/usr/local/lib/symfony-1.4 -> /usr/local/lib/symfony-1.4.4

That way you can download the new release of symfony (say 1.4.5), and
just change the symlink & delete the old libraries. I don't remember
what I was doing before, but it was a mess compared to this.
--
Yitzchak Schaffer
Systems Manager
Touro College Libraries
33 West 23rd Street
New York, NY 10010
Tel (212) 463-0400 x5230
Fax (212) 627-3197
Email yitzchak.schaffer at tourolib.org

Access Problems? Contact systems.library at touro.edu
Konstantin K
2010-05-02 04:56:16 UTC
Permalink
This is why sys admins use stow from gnu
If your doc root is /var/www/html, have html be a symlink to current code.
/var/www/html -> /var/www/tag_XXXX
Perhaps this is obvious to many here, but I discovered this works wonders for vendor libraries like symfony - point the app's require statement to '/usr/local/lib/symfony-1.4', and symlink
/usr/local/lib/symfony-1.4 -> /usr/local/lib/symfony-1.4.4
That way you can download the new release of symfony (say 1.4.5), and just change the symlink & delete the old libraries. ?I don't remember what I was doing before, but it was a mess compared to this.
--
Yitzchak Schaffer
Systems Manager
Touro College Libraries
33 West 23rd Street
New York, NY 10010
Tel (212) 463-0400 x5230
Fax (212) 627-3197
Email yitzchak.schaffer at tourolib.org
Access Problems? Contact systems.library at touro.edu
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Leam Hall
2010-05-02 10:53:22 UTC
Permalink
Actually, we use "ln -s". :)

Leam
Post by Konstantin K
This is why sys admins use stow from gnu
If your doc root is /var/www/html, have html be a symlink to current code.
/var/www/html -> /var/www/tag_XXXX
Perhaps this is obvious to many here, but I discovered this works wonders for vendor libraries like symfony - point the app's require statement to '/usr/local/lib/symfony-1.4', and symlink
/usr/local/lib/symfony-1.4 -> /usr/local/lib/symfony-1.4.4
That way you can download the new release of symfony (say 1.4.5), and just change the symlink & delete the old libraries. I don't remember what I was doing before, but it was a mess compared to this.
--
Yitzchak Schaffer
Systems Manager
Touro College Libraries
33 West 23rd Street
New York, NY 10010
Tel (212) 463-0400 x5230
Fax (212) 627-3197
Email yitzchak.schaffer at tourolib.org
Access Problems? Contact systems.library at touro.edu
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
mmw
2010-04-29 17:58:27 UTC
Permalink
This relates back to a question I asked about source control, I think.

Subversion deploys from development to production? so it's source control,
too, but only runs on the server?

I'd love online development side that you can check in and out online, so
you have check in options.

Not all developers are used to working on the server. Back in the day, I
always worked on the server doing c coding.

But, a lot of times, I want to work on my own server then roll it to another
server.

Michele
-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of Matt Juszczak
Sent: Thursday, April 29, 2010 1:50 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Deploying PHP Applications
If you're doing tags, I would recommend an svn export vs. an svn checkout.
Branches, use svn checkout (so you can svn up)
-Matt
I don't see any reason not to.??? If you would prefer, you could run the
checkout from any server and FTP / SSH the files
up to production in the build script.?? Thats actually the better way to
go when you have multiple web servers.?? That
way can have one build script handle all of them instead of executing a
separate deployment on each server.
Jason
Ok so it's not crazy to put an svn client on a production server
for this
purpose.
Thanks for the tip!
Post by Jason Salsiccia
Here's how I to do it.
As you said, have a subversion client installed on the server running
your
Post by Jason Salsiccia
web host. ? If your doc root is /var/www/html, ?have html be a symlink
to
Post by Jason Salsiccia
current code.
/var/www/html -> /var/www/tag_XXXX
The build script checks out the new tag to the doc root in directory
/var/www/tag_newtagname. ? The last thing the build script does is
switch
Post by Jason Salsiccia
the html symlink from the old tag to the new tag to make the
deployment
Post by Jason Salsiccia
live.
Jason
On Thu, Apr 29, 2010 at 1:28 PM, Jeremy Hise <jhise at ledcity.net>
Post by Jeremy Hise
Hiya,
So I've recently been put in charge of a tech department at my
company.
Post by Jason Salsiccia
Post by Jeremy Hise
One issue that we are trying to get a handle on is a good way to get
our
Post by Jason Salsiccia
Post by Jeremy Hise
PHP applications from a development/staging environment to a
production
Post by Jason Salsiccia
Post by Jeremy Hise
server. The production servers are accessible via ssh/ftp/etc. One
quick
Post by Jason Salsiccia
Post by Jeremy Hise
thought would be to install a subversion client on the server and
have
Post by Jason Salsiccia
Post by Jeremy Hise
that export the application to a spot where a build script could then
set
it up. However, is there a "best-practices" way of doing this?
Thanks!
jeremy
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
Jeremy Hise
Application Developer
ledCity.net
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
CED
2010-04-30 23:24:33 UTC
Permalink
<?php
//GIVEN a page that is called with:
// $_GET['abc'] = 'def';
//CODED with:
$dynamic_vars['a']['b'] = 'abc';

// NO WORKY
echo $_GET[ $dynamic_vars['a']['b'] ] ;

// NO WORKY

if(isset($_GET[ $dynamic_vars['a']['b'] ])){
echo $_GET[ $dynamic_vars['a']['b'] ] ;
}
?>

What am I doing wrong?
(this is obviously for demonstration purposes only, the actually
variables have need for being stored in the manner that they are)

-Ed
Chris Snyder
2010-04-30 23:39:31 UTC
Permalink
<?php
// ? ?$_GET['abc'] = 'def';
? $dynamic_vars['a']['b'] = 'abc';
? // NO WORKY
? echo $_GET[ $dynamic_vars['a']['b'] ] ;
? // NO WORKY
? if(isset($_GET[ $dynamic_vars['a']['b'] ])){
? ? ?echo $_GET[ $dynamic_vars['a']['b'] ] ;
? }
?>
What am I doing wrong?
(this is obviously for demonstration purposes only, the actually variables
have need for being stored in the manner that they are)
-Ed
Sample code works for me, php 5.3.2.
CED
2010-05-01 00:32:24 UTC
Permalink
Post by Chris Snyder
Post by CED
<?php
// $_GET['abc'] = 'def';
$dynamic_vars['a']['b'] = 'abc';
// NO WORKY
echo $_GET[ $dynamic_vars['a']['b'] ] ;
// NO WORKY
if(isset($_GET[ $dynamic_vars['a']['b'] ])){
echo $_GET[ $dynamic_vars['a']['b'] ] ;
}
?>
What am I doing wrong?
(this is obviously for demonstration purposes only, the actually variables
have need for being stored in the manner that they are)
-Ed
Sample code works for me, php 5.3.2.
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
That has got to be it then... 5.2.3 on this box... checking the
changelog now; Thank you Mr. Snyder. :D
--
<img src="Loading Image..." border ="0">
995 Maple Hill Road
Castleton, New York 12033
518-331-5061
Consult at CovenanteDesign.com
Anthony Wlodarski
2010-05-01 01:46:31 UTC
Permalink
I don't think it is the version of PHP you are using for example from my box:

anthony at anthony-desktop:~$ php -v
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan 6 2010 22:41:56)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
anthony at anthony-desktop:~$ php -a
Interactive shell

php > $_GET['abc'] = 'def';
php > $dynamic_vars['a']['b'] = 'abc';
php > echo $_GET[$dynamic_vars['a']['b']];
def
php > if(isset($_GET[$dynamic_vars['a']['b']])) {
php { echo $_GET[$dynamic_vars['a']['b']];
php { }
def

As you can see I am on 5.2.10-2.

-Anthony


________________________________
From: CED <consult at covenantedesign.com>
To: NYPHP Talk <talk at lists.nyphp.org>
Sent: Fri, April 30, 2010 8:32:24 PM
Subject: Re: [nycphp-talk] PHP Dynamic GET Variables , Do they exist?
Post by Chris Snyder
Post by CED
<?php
// $_GET['abc'] = 'def';
$dynamic_vars['a']['b'] = 'abc';
// NO WORKY
echo $_GET[ $dynamic_vars['a']['b'] ] ;
// NO WORKY
if(isset($_GET[ $dynamic_vars['a']['b'] ])){
echo $_GET[ $dynamic_vars['a']['b'] ] ;
}
?>
What am I doing wrong?
(this is obviously for demonstration purposes only, the actually variables
have need for being stored in the manner that they are)
-Ed
Sample code works for me, php 5.3.2.
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
That has got to be it then... 5.2.3 on this box... checking the
changelog now; Thank you Mr. Snyder. :D
--
995 Maple Hill Road
Castleton, New York 12033
518-331-5061
Consult at CovenanteDesign.com


_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100430/d967828f/attachment.html>
CED
2010-05-01 03:33:02 UTC
Permalink
Post by Anthony Wlodarski
anthony at anthony-desktop:~$ php -v
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan 6 2010 22:41:56)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
anthony at anthony-desktop:~$ php -a
Interactive shell
php > $_GET['abc'] = 'def';
php > $dynamic_vars['a']['b'] = 'abc';
php > echo $_GET[$dynamic_vars['a']['b']];
def
php > if(isset($_GET[$dynamic_vars['a']['b']])) {
php { echo $_GET[$dynamic_vars['a']['b']];
php { }
def
As you can see I am on 5.2.10-2.
-Anthony
------------------------------------------------------------------------
*From:* CED <consult at covenantedesign.com>
*To:* NYPHP Talk <talk at lists.nyphp.org>
*Sent:* Fri, April 30, 2010 8:32:24 PM
*Subject:* Re: [nycphp-talk] PHP Dynamic GET Variables , Do they exist?
On Fri, Apr 30, 2010 at 7:24 PM, CED <consult at covenantedesign.com
Post by CED
<?php
// $_GET['abc'] = 'def';
$dynamic_vars['a']['b'] = 'abc';
// NO WORKY
echo $_GET[ $dynamic_vars['a']['b'] ] ;
// NO WORKY
if(isset($_GET[ $dynamic_vars['a']['b'] ])){
echo $_GET[ $dynamic_vars['a']['b'] ] ;
}
?>
What am I doing wrong?
(this is obviously for demonstration purposes only, the actually
variables
Post by CED
have need for being stored in the manner that they are)
-Ed
Sample code works for me, php 5.3.2.
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
That has got to be it then... 5.2.3 on this box... checking the
changelog now; Thank you Mr. Snyder. :D
--
995 Maple Hill Road
Castleton, New York 12033
518-331-5061
Consult at CovenanteDesign.com <mailto:Consult at CovenanteDesign.com>
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
------------------------------------------------------------------------
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
I couldn't find anything in the changelog... so that would make sense.

Could you pass the variable in from the url, instead of assigning it
like an array...and let me know...
--
<img src="http://covenantedesign.com/logo.jpg" border ="0">
995 Maple Hill Road
Castleton, New York 12033
518-331-5061
Consult at CovenanteDesign.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100430/eb49e0d3/attachment.html>
Jeremy Hise
2010-05-01 04:21:33 UTC
Permalink
I did your example, followed by:

<a href = 'test.php?abc=123'>Test</a>

(my test page is called test.php)

And it worked.

The first thing I would do would be:

print(nl2br(print_r($_GET, true)));

And see what is actually stored in the $_GET array.
Post by Anthony Wlodarski
I don't think it is the version of PHP you are using for example from
anthony at anthony-desktop:~$ php -v
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan 6
2010 22:41:56)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
anthony at anthony-desktop:~$ php -a
Interactive shell
php > $_GET['abc'] = 'def';
php > $dynamic_vars['a']['b'] = 'abc';
php > echo $_GET[$dynamic_vars['a']['b']];
def
php > if(isset($_GET[$dynamic_vars['a']['b']])) {
php { echo $_GET[$dynamic_vars['a']['b']];
php { }
def
As you can see I am on 5.2.10-2.
-Anthony
------------------------------------------------------------------------
*From:* CED <consult at covenantedesign.com>
*To:* NYPHP Talk <talk at lists.nyphp.org>
*Sent:* Fri, April 30, 2010 8:32:24 PM
*Subject:* Re: [nycphp-talk] PHP Dynamic GET Variables , Do they exist?
On Fri, Apr 30, 2010 at 7:24 PM, CED <consult at covenantedesign.com
Post by CED
<?php
// $_GET['abc'] = 'def';
$dynamic_vars['a']['b'] = 'abc';
// NO WORKY
echo $_GET[ $dynamic_vars['a']['b'] ] ;
// NO WORKY
if(isset($_GET[ $dynamic_vars['a']['b'] ])){
echo $_GET[ $dynamic_vars['a']['b'] ] ;
}
?>
What am I doing wrong?
(this is obviously for demonstration purposes only, the actually
variables
Post by CED
have need for being stored in the manner that they are)
-Ed
Sample code works for me, php 5.3.2.
______________
CED
2010-05-01 13:08:31 UTC
Permalink
Post by Jeremy Hise
<a href = 'test.php?abc=123'>Test</a>
(my test page is called test.php)
And it worked.
print(nl2br(print_r($_GET, true)));
And see what is actually stored in the $_GET array.
Post by Anthony Wlodarski
I don't think it is the version of PHP you are using for example from
anthony at anthony-desktop:~$ php -v
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan 6
2010 22:41:56)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
anthony at anthony-desktop:~$ php -a
Interactive shell
php > $_GET['abc'] = 'def';
php > $dynamic_vars['a']['b'] = 'abc';
php > echo $_GET[$dynamic_vars['a']['b']];
def
php > if(isset($_GET[$dynamic_vars['a']['b']])) {
php { echo $_GET[$dynamic_vars['a']['b']];
php { }
def
As you can see I am on 5.2.10-2.
-Anthony
------------------------------------------------------------------------
*From:* CED <consult at covenantedesign.com>
*To:* NYPHP Talk <talk at lists.nyphp.org>
*Sent:* Fri, April 30, 2010 8:32:24 PM
*Subject:* Re: [nycphp-talk] PHP Dynamic GET Variables , Do they exist?
On Fri, Apr 30, 2010 at 7:24 PM, CED <consult at covenantedesign.com
Post by CED
<?php
// $_GET['abc'] = 'def';
$dynamic_vars['a']['b'] = 'abc';
// NO WORKY
echo $_GET[ $dynamic_vars['a']['b'] ] ;
// NO WORKY
if(isset($_GET[ $dynamic_vars['a']['b'] ])){
echo $_GET[ $dynamic_vars['a']['b'] ] ;
}
?>
What am I doing wrong?
(this is obviously for demonstration purposes only, the actually
variables
Post by CED
have need for being stored in the manner that they are)
-Ed
Sample code works for me, php 5.3.2.
______________
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
That was it, the posting page wasn't passing any variables (it parses an
few inifiles)... thanks for the PHP101 refresher guys.
--
<img src="http://covenantedesign.com/logo.jpg" border ="0">
995 Maple Hill Road
Castleton, New York 12033
518-331-5061
Consult at CovenanteDesign.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100501/ddbb044d/attachment.html>
Continue reading on narkive:
Loading...