
08-04-2008, 05:39 AM
|
|
|
|
Programming on tow servers with PHP
Hello,
I have a huge website with some sub domains.
we set each sub domains on a separate servers because each sub domain have high pressure on one server.
Now I have a question.
our user accounting system is located on forum.domain.com on a server, now I want to use the cookies and user information on my another sub domain which located on another server for example test.domain.com.
our forum system is vBulletin , I can access to user information when my another sub domain located on forum server with this code :
require_once("global.php");
$userID = $vbulletin->userinfo['userid'];
$userName = $vbulletin->userinfo['username'];
but I want to know how can I do it when that sub domain not located on the server of forum.
Regards,
|

08-04-2008, 05:45 AM
|
|
View Beta Profile
Community Guide
|
|
Join Date: Jan 2006
Location: Athens, Greece
Posts: 1,403
|
|
|

08-04-2008, 06:12 AM
|
|
|
Not a programming suggestion, but have you considered setting up an NFS mount between each server and setting the php session_savedir variable the same way on each?
Not a good idea unless each server is very close to one another though. It'd be good if they were both on the same internal network with gigabit connectivity though.
|

08-04-2008, 10:38 AM
|
|
|
Quote:
Originally Posted by ub3r
have you considered setting up an NFS mount between each server
|
NFS is not a secure protocol, so make sure you know what you are doing (or get help form someone who does) if you decide to implement this.
|

08-04-2008, 10:40 AM
|
|
View Beta Profile
Aspiring Evangelist
|
|
Join Date: Jan 2005
Location: North-East, Indiana
Posts: 417
|
|
 that's very weird... he's trying to share cookies yeah???
Won't his cookies be stored as
xxx.com
sub.xxx.com
????
How could he share the cookies in that stand point?
__________________
• PHP5 / MySQL / CUSTOM TEMPLATING / CLEAN & MAINTAINABLE CODING
• WEB DEVELOPMENT via CUSTOM DESIGN / PROGRAMMING
|

08-04-2008, 10:45 AM
|
|
|
I assume the OP is passing the information between the 2 subdomains using a common database. Each subdomain can access the database.
|

08-06-2008, 05:37 AM
|
|
|
Quote:
Originally Posted by qbert220
NFS is not a secure protocol, so make sure you know what you are doing (or get help form someone who does) if you decide to implement this.
|
running it on a local network only would be the best move.
|

08-06-2008, 05:49 AM
|
|
|
Quote:
Originally Posted by ub3r
running it on a local network only would be the best move.
|
Agreed - This will prevent data being snooped. I was presuming that the server is available over the entire internet. Therefore care must still be taken not to expose NFS mounts to the internet.
|

08-06-2008, 12:13 PM
|
|
View Beta Profile
Aspiring Evangelist
|
|
Join Date: Jan 2005
Location: North-East, Indiana
Posts: 417
|
|
Quote:
Originally Posted by qbert220
I assume the OP is passing the information between the 2 subdomains using a common database. Each subdomain can access the database.
|
true
I would definitely connect via 'localhost' because you find yourself hurting if your mounts get exposed.
__________________
• PHP5 / MySQL / CUSTOM TEMPLATING / CLEAN & MAINTAINABLE CODING
• WEB DEVELOPMENT via CUSTOM DESIGN / PROGRAMMING
|

08-28-2008, 03:36 AM
|
|
|
Thanks for replies,
But I cannot use only cookies , because vbulletin recommended we should use global.php for getting user information, so I should include global.php from my another server to my program , can I do it ?
Regards,
|

08-28-2008, 04:15 AM
|
|
|
Quote:
Originally Posted by webhostbeginner
Thanks for replies,
But I cannot use only cookies , because vbulletin recommended we should use global.php for getting user information, so I should include global.php from my another server to my program , can I do it ?
Regards,
|
yes, read up on nfs.
|

08-29-2008, 07:08 AM
|
|
|
Quote:
Originally Posted by ub3r
yes, read up on nfs.
|
Sorry I cannot understand, would you please explain about your suggestion?
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|