Deployment/Security questions

A place for users and developers of the Xataface to discuss and receive support.

Postby rbchen » Tue Apr 24, 2007 12:42 pm

Hi Steve:

Can I use one instance of dataface to run multiple sites? For example, I have http://abc.com/site1, http://abc.com/site2, and http://abc.com/site3. Each site will have its own database and database users. Can I have them all point to http://abc.com/dataface? Or do I need to have http://abc.com/dataface1, http://abc.com/dataface2....?

My guess is not because I saw the AuthenticationTool is a singleton object. However, if it is possible, will there be any security issues?

If the answer is no, what suggestion you have for deploying multiple sites under the same domain?

Thank,
Raymond
rbchen
 
Posts: 21
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Apr 24, 2007 2:18 pm

Hi Raymond,

Absolutely.Ê This is the intention.Ê I have dozens of applications running on a single dataface installation.Ê It makes it easy for upgrading because upgrading Dataface once, upgrades all of the applications.
You don't need to worry about the scope of objects like the AuthenticationTool (which is indeed a singleton object - as is the Dataface_Application object and many more) because PHP applications do not persist between requests.Ê In other words a Singleton object is only maintained for the scope of a single request.Ê Multiple applications will not conflict.
The only bit of advice that will be different for running multiple sites vs running a single site is that it is very advisable for each application to have its own templates and templates_c directories
One other thing to note (and this is not Dataface specific) is that running multiple sites on the same domain will result in common session data.Ê This means that if you log into one site and then navigate to another, it may still have you "logged in" on the other site.Ê This isn't cause for too much concern though, because if the user that you are logged in as doesn't have any special permissions for the other application, he still won't be able to do anything.Ê I.e. this isn't anything to worry about.
Hope this helps a little.
-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Deployment/Security questions

Postby jessehd09 » Mon Jul 19, 2010 9:27 am

I have recently been tasked to create another datafase application on an existing installation on a RHEL server. I am having some trouble getting the new configured correctly using the makesite script and was wondering if there was any documentation for this. I have run through the documentation as well as the forum, but can seem to fine any solid tutorial for the process.

I am using the makesite script found in the original location (/var/www/html/foo/dataface/makesite) and point to where I want the new.

Code: Select all
/var/www/html/foo/dataface/makesite /var/www/html/new usr:pass@localhost/dba_name /new


The script queries the database successfully and creates the subdirectories under /var/www/html/new/tables/... and prints "Site successfully created at '/var/www/html/new". However there still seems a problem here. When I attempt to access this application I receive a blank browser page and when referencing the httpd logs I find the following errors where 'x' equals the first table within the database.

Code: Select all
PHP Fatal error:  The table 'x' has no primary key.  Please add one. in /var/www/html/foo/dataface/Dataface/QueryTool.php on line 101


Any assistance or documentation would greatly be appreciated.
jessehd09
 
Posts: 1
Joined: Mon Jul 19, 2010 9:11 am

Re: Deployment/Security questions

Postby cantlep » Mon Jul 19, 2010 12:38 pm

Each table requires a Primary Key for Xataface to function correctly. Hopefully, in your table, there is a column that is unique (perhaps an auto incrementing number)...or similar. If so, you could do it in mysql like this
Code: Select all
ALTER TABLE yourtable ADD PRIMARY KEY (column);


or if you're using phpMyAdmin then you can just click the little key icon on the right hand side after the column name.

Rgds
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 35 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved