|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
muralik Smarty Rookie
Joined: 08 Mar 2004 Posts: 25
|
Posted: Mon May 10, 2004 3:56 am Post subject: single script shared by multiple websites |
|
|
Hi,
I would like to get some idea if anyone have done this.
I want to have single instance of script on the server, and that script should be shared by multiple websites.
I wrote a script which access the database and uses smarty template system. i am specifying the table names in a configuration file.
I want to put the script at one place and all the websites should get different data based on the configuration file. and I the template directory is also specified in the configuration file.
So if there is some plugin change or soemthing, i will just change in the main script and all the websites will be reflected. and i will change the templates on each site accordingly.
Anyone help me on this type of framework,
I have apache webserver, when i create virtual hosts, do i need to map the sites for the same directory where script is installed? or shall i have some static links to that directory? |
|
Back to top |
|
xces Smarty Regular
Joined: 09 Apr 2004 Posts: 77
|
Posted: Mon May 10, 2004 10:34 am Post subject: |
|
|
You need to allow the scripts on the other sites to access the directory with your main scripts. Look for more information on open_basedir. As this is a security risk, not many hosts will allow this unless you have your own server. |
|
Back to top |
|
muralik Smarty Rookie
Joined: 08 Mar 2004 Posts: 25
|
Posted: Mon May 10, 2004 10:36 am Post subject: my server |
|
|
it is my server,
I will look at what you mentioned,
I have to use the same script for different websites...
thanks will reply once i go through that.. |
|
Back to top |
|
Justin Smarty Regular
Joined: 07 May 2003 Posts: 38 Location: Vilnius, Lithuania
|
Posted: Mon May 10, 2004 11:32 am Post subject: |
|
|
Your idea is great.
But I think, that there are to many complex projects and such projects requires unique solutions. Few similar tables wouldn't be enough, I guess.
What do you think about this? _________________ http://www.baubas.net |
|
Back to top |
|
muralik Smarty Rookie
Joined: 08 Mar 2004 Posts: 25
|
Posted: Mon May 10, 2004 3:00 pm Post subject: partial setup |
|
|
I have done something partially, I actually didnt do anything to the script yet, didnt write configuration file yet,
probably i need to write a configuration file which will set
directory for templates
directory for smarty cache/compile directories
table prefix
database tables (such as categories, links etc)
My scripts are located in /www/virthosts/portal
and in the apache webserver httpd.conf
Code: | Alias /engine/ "/www/virthosts/portal/"
<Directory "/www/virthosts/portal/">
DirectoryIndex index.php
</Directory> |
so here i made "engine" directory alias and in the .htaccess of the new website
and in my Virtualhost configuration
Code: | ServerName naveenroyal.local
<Directory /www/virthosts/naveen>
AllowOverride All
Options FollowSymLinks
</Directory> |
and in the .htaccess file of the Virtual host (naveenroyal.local)
Code: | RewriteEngine On
RewriteBase /
RewriteRule ^site/detail/?([0-9]{1,2})?/?(.*) /engine/detail\.php?id=$1&dir=$2
RewriteRule ^site/categories/?([0-9]{1,2})?/?(.*) /engine/sections\.php?id=$1&dir=$2 |
now if i go http://naveenroyal.local/site/categories/1/murali
i get what i want
I have given something like this and voila, i can see the output of that site and it looks like the script is running as if on the same site. images are not coming, i still need to check why they are not coming, i think some problem .htaccess rewrite rule.
But still i need to some R & D on this, if any have more ideas please let me know.
I might also have issues with smarty templates/compile directories.. i donno, i will soon work on that as well |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|