LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-19-2004, 02:24 PM   #1
goe
LQ Newbie
 
Registered: Aug 2004
Location: Boston, US
Distribution: Fedora2
Posts: 1

Rep: Reputation: 0
Question Apache+php on one server and MySQL on another server?


Hi,

I'm using Fedora2 distribusion and I'm rather fresh in linux. Basiclly I'm trying to put Apache+php on one server and MySQL on onother server and make them talk to each onther.

I have two machines, both with Fedora2. One has apache+php and the other one MySQL database instaled. I have them in local network.

First server's IP is 192.168.3.20 (Apache + php)
Second server's IP is 192.168.3.21 (MySQL)

So instead calling "localhost" in php scripts hosted on first server I know I have to call second server IP (192.168.3.2) but my man question is how to configurate the second server to pass queries to MySQL DB and then send back results back to first server...?

Or maybe my thinking is wrong...
Please keep any answers simple to understand for newbie like me

Last edited by goe; 08-19-2004 at 02:40 PM.
 
Old 08-19-2004, 03:12 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
When your first server calls mysql_connect from PHP with the proper arguments it will open a connection the the MySQL service on your second server, and all communication will be passed over this link, so there's nothing further to be done. Just make sure that your MySQL server is listening on port 3306 (and not just over a local socket) on the second machine.
 
Old 08-19-2004, 04:02 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,570

Rep: Reputation: 171Reputation: 171
mysql_connect ( '192.168.3.21:3306' , 'user', 'pass')
That's all. Change port (3306) if you're planning to use a different one.
 
Old 08-19-2004, 04:25 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
You will also need to make sure that the user you are trying to connect as, has permission to connect from the web server and not just the local to the sql server.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL Server + Apache Server + PHP gabriellai Linux - Networking 7 05-26-2005 12:03 PM
how do i Know Apache PHP MYSQL Installed on my Dedicated Server? phpsharma Linux - Newbie 3 04-18-2005 05:40 PM
PHP/MySQL and Apache server setup nenyo Linux - Software 7 02-12-2005 01:48 PM
Dreamweaver, PHP, MySQL, and Apache Web server bentman78 Linux - Software 18 02-06-2005 05:09 AM
Installing PHP and MySQL w/ Apache web server dcrealm47 Linux - Newbie 5 02-26-2003 11:21 AM


All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration