Reply to Re: sessions/cookies and sharing files between multiple servers

Your name:

Reply:


Posted by Gordon Burditt on 11/03/06 23:16

>I have a php/mysql website where people can upload their own graphics for
>the buttons and background of pages on the website.
>
>This used to run on one server, but I have now been asked to set it up on
>multiple servers.

Why? The reason matters. If it's a matter of more horsepower with lots
of little machines rather than one huge one, that's one thing. If it's
redundancy for extreme reliability, that's another.

>The problem is that when someone uploads a file, how do I distribute it to
>all of the servers? Should I use php to send it to all of the servers once
>it has been uploaded, or is there a better way of synchronizing the files
>between all of the servers?

NFS shared filesystem? Or you divide the files between the systems?

>Also, I am not sure how autologin (based on cookies) and sessions will
>work when distributing across multiple servers, as my understanding is
>that these are on a per domain basis? (i.e. if someone goes to
>node1.site.com and hits autologin, but next time gets node3, the cookie
>wont be picked up?)

If you're using a round-robin DNS scheme or something fancier with
routers and switches for load-balancing, the browser won't know the
difference between node1.site.com and node3.site.com, because it
thinks they're all node.site.com, and you won't have an issue with
domains. Otherwise, use domain cookies rather than individual host
cookies for the session cookie.

It is possible to use a session save handler to put session data
in a MySQL (or other) database rather than a bunch of little files.
If you share this database between webservers, one login can work
across several machines. Also, putting the session data in a
database makes it much easier to expire old data.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация