Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inlcude across web?

Status
Not open for further replies.

idtstudios2

Programmer
Aug 12, 2005
35
US
I have many websites that exist on many webservers in many countries. All of the sites pull template files from "template.mainsite.com". This allows us to have around ninety sites pull off of one set of template files. You can imagine how usefull and time saving this is.

Now, the problem is that before now we have used html for everything but we have recently switched everything to php in order to add some content. the template files now contain php and since you we can't really "include" them acoss the web we have a major problem.

Is there any work around on this? any tips?

Thanks
 
they should include() with a reasonable degree of success, depending on what sort of load the template server can handle - provided it runs php too.

Alternatively, hmm tricky. copy them out to each server ?

Serve the template code from a database(eg mysql) for processing server side?



______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
If you need to be able to include the PHP source code on all servers, you could (on a unix-like OS) provide symbolic links from all your template .php files to template .phps files. Then configure your web server to pass out the source code of .phps files.

If you point a web client (which, when including a PHP script via a URL, PHP effectively becomes) to foo.php, you get the output of the script run. If you point the web client to foo.phps, you get the PHP source code.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
If you point the web client to foo.phps, you get the PHP source code.
You can view the source code complete with colour highlighting.

You probably can't do much with it tho.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
thanks for the replies guys. I'm going to try the .phps option and see if it works. We had thought about putting them in a database but our three db servers are already overwhelmed and we already have template.mainsite.com load balancing between two servers.

thanks again.
 
Your templates should be local. I would just make something to distribute all the templates to all the sites (update them) when the templates at the mainsite change.. or something. Pulling templates across the internet seems like a lot of time lost for whoever is viewing the site
 
this method also sounds like a great big security risk if not done correctly.
 
This is what we've decided on:

Having two load balanced servers in two datacenters (one in USA and one in HK) for distributing template files. This will hopefully reduce load times a little bit. Since we are having to pull the templates as source anyways, we went ahead and encrypted them. Images are distributed to each and every server reducing the overall template files (altogether) to 15KB. So i think we're going to be ok as far as speed and even if someone figures out which servers store template files they will atleast have to deal with a bit of trouble to read them.


IF this plan fails we also have a backup plan ready to go which involves clustering the servers and delivering template files to each cluster.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top