473,387 Members | 1,534 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,387 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 1739
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.