473,770 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1754
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*******@attgl obal.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
2280
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 hours wrong. The time should be GMT minus 6 hours. Can anyone help me with that? Her's the code: <?php header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache");
6
2834
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 domain names have been removed in everything below.) SYNOPSIS: I have 2 target servers, at https://A.com and https://B.com. I have 2 clients, wget and my python script.
10
2278
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 -----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
4
14403
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 only one thing left I could not figure out so far. How can I get the list of dns servers used by my computer? The code must work under any Windows version with .NET framework support. Any ideas are welcome.
4
1473
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 restarted. If I have a list of the servers, all with same root password, and the connection is ssh. How do I connect to the server, cat the line to the config file, stop adn start the agent, and then do same to next server in list and iterate...
13
2411
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 restarted. If I have a list of the servers, all with same root password, and the connection is ssh. How do I connect to the server, cat the line to the config file, stop adn start the agent, and then do same to next server in list and iterate...
1
2647
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 don't know how to construct it i have read numerous books and have managed to get a pseudo code for how it should be which is Algorithm spanningTree (graph) Determine the minimum spanning tree a network. Pre graph contains a network Post...
10
1823
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 memory access to the database. Also disallows http:// includes. This is where the database of names is stored. This is our internal MySQL server. Server 2 - Only allows shared memory access to the database. So anything that calls the...
0
9617
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10037
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8931
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.