PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old June 11th, 2004, 09:56 AM
Archemides Archemides is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 25 Archemides User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Archemides Send a message via AIM to Archemides Send a message via Yahoo to Archemides
Peer-to-peer PHP and MySQL

How would one implement a small database on a 5 user peer-to-peer network using php and mysql? I would be very curious to see examples of how to do this.


I suppose all I would need to know is how to point one's browser to the ip address of the "server" machine which would have apache, php, and mysql on it... is this very complex to achieve?

I am really very much of a self-taught beginner, so I profit most from answers, examples, which are very step-by-step (step one, do this... step 2, do that)....

Here are a few links which I found in a hasty google search on this "P2P" topic.
Thanks for any advice or direction!

==================================

http://www.mysql.de/www/news-and-events/users-confe

rence/2003/session.html


http://www.vbmysql.com/forums/index.php?t=msg&th=01

7580%09&start=0

http://www.openp2p.com/pub/a/p2p/2000/11/24/shirky1

-whatisp2p.html

http://volnet.utk.edu/p2p/

http://www.badblue.com/helpoth.htm

Reply With Quote
  #2  
Old June 11th, 2004, 01:37 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
By definition, if you have one server and several clients that access it, it's not a p2p network -- at least not for that service. That said, so long as you're proficient at installing and configuring software, what you're wanting to do is simple. Getting apache, php, and mysql talking to one another on Linux is simple (again, if you're comfortable installing software on Linux), and then it's just a matter of making sure you've got your firewall open to the other systems, which should be able to hit the server by IP. Best way to start? Download apache. Configure, make, make install. Lather, rinse repeat. Download mysql. Configure, make, make install. Download PHP. You get the idea. Each of these packages should have README and INSTALL files that give you the more granular step-by-step instructions.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old June 11th, 2004, 02:31 PM
Archemides Archemides is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 25 Archemides User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Archemides Send a message via AIM to Archemides Send a message via Yahoo to Archemides
Windows, not Linux

Thanks your your answer, but I am really no better off now then before. Where I work, there are 5 Dell computers running Windows XP Home edition, and they are connected so that they may share printers, and look at common folders (I did not connect them, a very high priced and close mouthed consultant came in and did that.)

What I really need, to help me, is a step by step explanation of how to get one of the other workstations to be able, through a browser, to bring up a page served by an Apache installation on the other workstation.

I had great success on my home machine, running windows 98, to install Apache, PHP, MySQL, and access it through my browser using localhost. I realize that I can drop to MSDOS and issue the ipconfig command at a workstation, and see its IP address.

Surely there is someone "out there" who has the knowledge and ability and time to outline the few steps (i am imagining that it is only a few), to accomplish what I am trying to do. I really am very much of a beginner, and totally self-taught (oh, and we dont have tons of money to throw at some consultant to come in and get it working). But it would be so nice to have a free server like MySQL, and a great language like PHP, and be able to share our own simple database between the several workstations.

Certainly, I could use my website which offers mysql and php, and allow the work stations to access applications there (but then there are security issues, since the rest of the world can go there as well).

Our five machines do have DSL connection to the Internet, and if we were to share a local mysql database via ip addresses, well, it would be essential that it in no way interfere with normal access to the internet.

Thanks so much for your efforts. But I really do need to find some place which says "Now that you have successfully installed Apache and MySQL and PHP on one of your five workstations, then go to your MSDOS prompt, and issue ipconfig to discover the ip address of that workstation (i am making up imaginary instructions), and then run the foo-bar utility to allow windows to recogize a whatchamacallit link with your localhost through port 80.... and then download the free foomanchoo driver to install on each of the other machines.... and then initialize the foomanchoo driver with the ip address... and .. (yada yada yada)..... I.E. step by step how you make it work (or as close to step by step as possible)....

I realize this may be asking a lot.... but it never costs to ask, and the worst that can happen is nothing.....

It just seems to me that if I had an apache server on one of the five machines, successfully serving webpages and php and mysql to the browser on THAT machine,... that there must only be some simple steps (or things to do with ip addresses) to allow the other 4 machines to access that mysql database through THEIR browsers (yet without clobbering the access which they already have to the Internet through DSL). Thanks for your patience, if you can point me in the right direction....

p.s. If what I am describing is not true "peer 2 peer", then, forgive my ignorance.... but is there some way to do what I want in such a windows environment.

Reply With Quote
  #4  
Old June 11th, 2004, 03:40 PM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
Configuring apache php and mysql in a windows environment is easy enough. Theres a couple of tutorials on devarticles (written by a mate of mine) which cover how to do this so theres no point repeating that.

Once you have a webserver running on that machine the other computers on the network can see the pages being served by going to http://server_ip_address/folder_name. eg http://192.168.0.1/hello_world.

Its easy as that. If you have any more questions related to this feel free to give us a shout. As you say it doesn't cost anything to ask although you should always feel free to mail me money

-KM-

Reply With Quote
  #5  
Old June 11th, 2004, 03:44 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
So long as you get apache/php/mysql running on one of the servers, there should be no other special instructions for you to follow. It's impossible for anybody who doesn't know your network intimately to give you what you're asking for. For example, you may be running all sorts of firewall or virus protection software that prevents you from being able to run apache. Without knowledge of your system, nobody can give you explicit instructions. The best one can do is to say "install the software, find out the IP of the machine it's running on, make sure the firewall's open locally for the appropriate ports on that machine, and try to connect to it."

I imagine you're on a LAN that uses local IP addresses internally. That's the situation at my company, in any case, and on my home network. If so, then your systems probably have an IP address like 192.168.100.3 that is valid inside your network but not outside. That is, you should be able (ports and services willing) to connect to a machine on your local network by one of these addresses, but if it's not a public IP, I can't connect to it from my network. So once you've got apache, etc., running, you have only to find the IP address (ipconfig seems like a good starting point) of the server and browse to it, same as any server.

In short, unless you've got a really weird setup, there should be no additional tasks required other than to get the server running, find its IP address, and type it in your browser. No special drivers or conflicts with DSL.

Your network may be a peer-to-peer network (I'm no expert on that topic), but the http protocol is not a peer-to-peer protocol, so it doesn't make sense to talk about it in terms of p2p. Just get apache/php/mysql set up, find the server's IP, open a browser on another of the 5 systems, type the IP into the location bar, and enjoy.

If that doesn't work, then you've either not got apache running properly (test by going to the server and trying to access localhost -- if it fails, apache's not running properly) or you've got firewall/routing issues keeping you out, in which case only somebody who knows the structure of your network can really help you out.

Reply With Quote
  #6  
Old June 11th, 2004, 05:30 PM
Archemides Archemides is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 25 Archemides User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Archemides Send a message via AIM to Archemides Send a message via Yahoo to Archemides
Wow, Thanks! dhouston and Kode_Monkey

Wow, Kode_Monkey and dhouston, thanks a million.

Your answers are quite helpful to me. I can now clearly see and understand how to attempt to access the server from the other stations:
e.g. kode_monkey's post

by going to http://server_ip_address/folder_name.

eg http://192.168.0.1/hello_world.


I can get the ip address from msdos: ipconfig

The WAMP install (windows, apache, mysql, php) should be easy for me, since I already did it once successfully at home on my Windows 98 machine.

And that was before I ran out and bought SAMS "Teach yourself WAMP", with a CD that has a WAMP install, as well as Mohammed Kabir's "Writing Secure PHP applications" (also with a CD which has a WAMP install)... and a google search pointed me to a WAMP install specific for XP... so I guess if one wamp install doesnt work, i can always uninstall it, and try out another.

We do have a primitive firewall in the form of zone alarm.... but I have been told that we dont really need it, since we are behind some other dsl router (and I'm not certain how effective zone alarm is anyway, but we have F-PROT as an anti virus), so, I could turn it off if it gives a problem...

dhouston, I understand what you mean when you wrote:
It's impossible for anybody who doesn't know your network intimately to give you what you're asking for
... but you see... we are very low budget... and we really have no one like that, no IT staff... and the consultant who did come in at a very high hourly price seemed to know less that I do in certain respects....


Yes, indeed, we do use local ip address internally, to share folders, and printers,... so indeed, everything would seem to hinge on ip addresses.


dhouston wrote: http protocol is not a peer-to-peer protocol, so it doesn't make sense to talk about it in terms of p2p. Just get apache/php/mysql set up, find the server's IP, open a browser on another of the 5 systems, type the IP into the location bar, and enjoy.


I guess I started to talk about the 5 machines as "peer to peer" because in the 1980s, I worked in an environment with Novell file servers.... and in my mind, when each machine can potentially look at folders on another machine, I thought of it as peer-to-peer, as opposed to something which actually has a dedicated file server.

Actually, a month or so ago, I stumbled across the existence of PHP and MySQL because I had found a database server called Apollo, which uses dbase type files, and is meant mainly, I think, for Delphi applications, and uses some form of odbc for clients to connect. I was intrigued by the notion that I could have the 5 workstations accessing one database. But then, when I realized the whole world of mysql and php, my eyes were opened.

Some years ago, in the early 90's, I was impressed by Btrieve, which is used in a number of accounting packages. They were coming out with a product which would allow applications to access data from a webserver.

There is also another dbase server product, Codebase, which claims to allow access over the internet, with a low cost, and small footprint, and fast speeds. And you would purchase drivers from them for Visual Basic, or Delphi, or Java, depending on your development language.


Also, there were some products which would allow Foxpro applications to access data from a website. I was very attracted by the ease of developoment in Foxpro. What bothered me about Foxpro was that there were always rumors that Microsoft would discontinue it in order to better promote other products like Visual Basic and SQLServer. The other thing is that Visual Foxpro developers had become enthralled with a pure OOP model for development. I could not really get my mind into OOP, since I had spent years doing top down structured programming in things like Cobol and RPG. I also found it difficult to get enthusiastic about a relational database like SQL query, when I had grown up as a programmer in navigational proprietary type back ends (go to record 5, read the next hundred records, now go to record 10,000 and read backwards for a 1000 records,... now write what you have captured to a temporary summary file, and NOW, pass the whole master file, and update a certain field with certain results...)

Well, now I have become comfortable enough with SQL to begin learning it with confidence that it wont go away. I feel comfortable investing my time in learning PHP, which a feeling that it wont become obsolete. And I feel like I can program procedurally to accomplish my ends, yet not feel shame that OOP (object oriented) purists will stick their noses up at it in disgust. And yes, I am trying to start using some classes and objects, but it will be a long journey for me down that yellow brick road to the land of OZ (and oop).

In all the above cases, my personal experience as a do-it-yourselfer, was that the price tag for the software was out of my range, and then, even if I were to purchase it, it would not work without spending a lot for "platinum support",... and even then, there was some possiblity that it would not work right, and even then, if you would get it to work, the product might be sold or abandoned, and your application might be "orphaned", with no further support. Also, it might work only for windows, but not on other OS platforms.

What I am experiencing now, in the world of MySQL and PHP and Apache, seems so beautiful, so free, with room for the super-user-guru-hacker-braniac, who instantiates entire from classes as one object with one swoop of his mouse (who leaps tall buildings with a single bound)... but also room for the simple teach-youself-weekend-warrior, who would simply like to get something simple but useful to work, for not a lot of money. And I feel like this environment is here-to-stay, and open to all, and not in the clutches and control of some evil empire super corporation, fenced in with big price tags.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Peer-to-peer PHP and MySQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway