473,216 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

Need a script spanning two servers suggestion.

I have a new situation I'm facing and could use a suggestion or two, as
I don't seem to be able to think in the abstract very well.

We have a local server which holds all of our image files.
We have a remote server that runs our public Web server and mySQL
database.
I need to be able to run a script that will:
Read the contents of a dir on the local server and
a. make thumbnails of the files in it
b. querey the database and pull information on each file based on the
filename
c. create a spreadsheet and e-mail it to 3rd parties

Now, I know how to do each of those things, don't need help there.
I just need a way to get it to span the two servers.

Here's what I was thinking:
1. Have the PHP script on the local server which processes the files
and sends the file names it processed...
2. Through a GET in a WGET back to another PHP script on the remote
server which pulls the database info for those filenames and creates
the spreadsheets/emails

or

1. Have the PHP script on the local server which processes the files
and sends the file names it processed to a local text file named with a
timestamp.
2. Then it initiates a WGET to a PHP script on the remote server
sending that filename in a GET which tells the remote script where to
find the list of filenames it needs to pull the information for from
the DB and generate the sheets/emails

or

1. Keep a constantly backed up version of the remote database on the
local server via SCP's of the exported database
2. Have the PHP script on the local server process the files AND do all
the DB queries and sheets/emails from the version of the DB that's been
backed up to it on a regular basis

What do you think? Or is there a better way that I'm just not thinking
of?
Thanks for any feedback!
Liam

Oct 5 '05 #1
5 1730
What i'm thinkin of is having all the work done on the local machine.

What would be required is a public_host name not "localhost" in order
to connect to the local database. Once you can create a connection from
your local machine to the remote machine, you're on!

I think this should do the job for you...once you have the other
functions of what you want to do with the information you obtain from
there.

What database are you connecting to though?? If it's MySQL it easy to
get this done...once u have the necessary rights on the remote machine.

Regards,
Gerard

Oct 5 '05 #2
ne**@celticbear.com wrote:
I have a new situation I'm facing and could use a suggestion or two, as
I don't seem to be able to think in the abstract very well.

We have a local server which holds all of our image files.
We have a remote server that runs our public Web server and mySQL
database.
I need to be able to run a script that will:
Read the contents of a dir on the local server and
a. make thumbnails of the files in it
b. querey the database and pull information on each file based on the
filename
c. create a spreadsheet and e-mail it to 3rd parties

Now, I know how to do each of those things, don't need help there.
I just need a way to get it to span the two servers.

Here's what I was thinking:
1. Have the PHP script on the local server which processes the files
and sends the file names it processed...
2. Through a GET in a WGET back to another PHP script on the remote
server which pulls the database info for those filenames and creates
the spreadsheets/emails

or

1. Have the PHP script on the local server which processes the files
and sends the file names it processed to a local text file named with a
timestamp.
2. Then it initiates a WGET to a PHP script on the remote server
sending that filename in a GET which tells the remote script where to
find the list of filenames it needs to pull the information for from
the DB and generate the sheets/emails

or

1. Keep a constantly backed up version of the remote database on the
local server via SCP's of the exported database
2. Have the PHP script on the local server process the files AND do all
the DB queries and sheets/emails from the version of the DB that's been
backed up to it on a regular basis

What do you think? Or is there a better way that I'm just not thinking
of?
Thanks for any feedback!
Liam


Liam,

First of all, it depends on the database you're using. For instance -
if you use MySQL, connecting to a remote server is quite simple - and
you basically treat it as it were a local database.

The image files are a little harder. Three ways I can think of to
access them:

1) Shared directory, where you can access the remote server's files as
if they were local,
2) FTP, where you just ftp the files from the remote, and
3) A PHP script running on the remote server which services the files
(similar to FTP).

Each way has its own advantages and disadvantages.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 6 '05 #3
Gerard wrote:
What i'm thinkin of is having all the work done on the local machine.
Yeah, that's what I'm hoping for too. =)
What would be required is a public_host name not "localhost" in order
to connect to the local database. Once you can create a connection from
your local machine to the remote machine, you're on!

I think this should do the job for you...once you have the other
functions of what you want to do with the information you obtain from
there.

What database are you connecting to though?? If it's MySQL it easy to
get this done...once u have the necessary rights on the remote machine.


Using mySQL.
Someone else also mentioned having the local server connect to the
remote mySQL DB. I'm leary of that, as I would need to be passing a
username/password over the net, right? Would it be plaintext like in
POP and FTP authorizations?
I think the mySQL database on the remote server is called "localhost,"
can that be changed without affecting how the Apache server on the
remote server connects to the DB on itself? That's pretty vital!

Thanks for the reply!
Liam

Oct 6 '05 #4

Jerry Stuckle wrote:
ne**@celticbear.com wrote:
What do you think? Or is there a better way that I'm just not thinking
of?
Thanks for any feedback!
Liam


Liam,

First of all, it depends on the database you're using. For instance -
if you use MySQL, connecting to a remote server is quite simple - and
you basically treat it as it were a local database.

The image files are a little harder. Three ways I can think of to
access them:


OK, so on the remote server I added a user and identified it with the
local server, and successfully connected to the remote from the local
in shell just fine!
Way cool.
But my concern, is in the PHP script, run on the local server, when it
sends the connect line, is it interceptible? Like a POP or FTP
connection? Could someone possibly get that username/password from the
establishment of the connection?
(That is assuming the file itself is safe on the server from someone
accessing it.)

As for the image files, they all rest on the local server, so if the
PHP script which runs the ImageMagick commands and the file
manaipulation stuff is also on the local server, it's all good. This
ability for the local server to access the remote mySQL server directly
solves all my problems!!

Just so long as it's secure.

Thanks for the reply!!
Liam

Oct 6 '05 #5
So I ran the mySQL DB connection to the remote host while Etheral was
running, and I captured the authentication packets.
It shows the IP, server, and username in plaintext, but it shows the
password as jumbled characters... I THINK MD5. Yes?
So, I see the password is encrypted before sending! Yeah!
But, if intercepted, can it be cracked?

Thanks for any feedback!
Liam

Oct 6 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gerry | last post by:
As I'm not a PHP-prgrammer at all, I just need Help with this: I have had a guestbook-page in Europe and will now have to move it to a US based-server. This makes the time-function showing time...
6
by: Paul Winkler | last post by:
This is driving me up the wall... any help would be MUCH appreciated. I have a module that I've whittled down into a 65-line script in an attempt to isolate the cause of the problem. (Real...
10
by: Don | last post by:
I thought I had this figured out, and have been able to do it in PHP on the server, but, how do I prefill an input field with a cookie value using JavaScript in a client-side page? Thanks, Don ...
4
by: Peter Gloor | last post by:
I'm writing an application that requires some dns queries (MX etc) not provided by System.Net.Dns. So far I managed to write my own dns class with methods to query a given dns server. There is...
4
by: gavino | last post by:
This seems easy but I have been asking tcl and python IRC chat all day and no one gave an answer. I have 100 servers which need a new backup server added to a text file, and then the backup...
13
by: gavino | last post by:
This seems easy but I have been asking tcl and python IRC chat all day and no one gave an answer. I have 100 servers which need a new backup server added to a text file, and then the backup agent...
1
by: jenny22 | last post by:
i have a problem i am very new to c++ and want to construct a minimum spanning tree for 8 stocks i have calculated in excel the relevant formulas and know the weights of each of gthe vertices but...
10
by: Jerim | last post by:
I am attempting to put together one script that pulls data from one database on its own server, and data from another database on its own server, which is off-site. Server 1 - Only allows shared...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.