Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed two Linux (Fedora 12) systems. One running Apache server or one running MySQL Server.

I want to make a connection with each other to run my web server. How can I do that?

share|improve this question

closed as not a real question by akira, slhck, Oliver Salzburg, Simon Sheehan, Ƭᴇcʜιᴇ007 Mar 23 '12 at 4:27

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

4  
Do you know how that stuff works in principle? You don't connect Apache with a MySQL server per se. Web applications that for example run in PHP need a MySQL connection defined, but Apache doesn't even need to know that you have a MySQL server. Your question isn't clear — what problem are you trying to solve? –  slhck Mar 22 '12 at 7:47
    
I am stablish a LAMP Web Server in my LAN. I am installed two Linux(Fedora) PC. I want that my one server allow for (Mysql) running as mysql Server for sql file and one for server run as a Apache server for core base. –  Abdul Kadir Mar 22 '12 at 11:07
    
Sorry, but you have to be more clear. I don't understand. What applications do you want to run on that Apache web server? What would you need the SQL database for? –  slhck Mar 22 '12 at 11:09
    
I have two server first server ip (10.0.0.12) or second server ip (10.0.0.25) on first server i want to run apache server such as running lms such as (10.0.0.12/lms) or i want my lms sql file should run from second server (10.0.0.25) I have install all LAMP services and it is running perfectly but i am unable to connect mysql from second system. core should be run from first server and sql file access from second server. guide my step my step. –  Abdul Kadir Mar 22 '12 at 13:41
    
Select a language for example PHP. When you write the PHP specify the IP address of the database server. $dbhandle = mysql_connect('10.0.0.25', $_SESSION["username"], $_SESSION["password"]) –  cybernard Apr 14 '13 at 17:07

2 Answers 2

In your MySQL Config, make sure that you change the binding from localhost to nothing or the Apache server.

You will see a line in /etc/mysql/my.ini (if that is where it installed to) called bind 127.0.0.1. Either comment out that line and restart the mysql service or put in the IP address of your apache box.

share|improve this answer

Usually, you'll get more help if you:

  • Ask a specific question
  • Show us what you've already tried

Here's a link to the PHP manual pages that describe how to connect to a MySQL instance from a PHP page. Read through it, and check out the examples Figure out which port MySQL is listening on (default is 3306, I think) and make sure that's open on your MySQL server.

Give that a shot and if you still have questions about this particular task, StackOverflow is probably a better place to ask it.

share|improve this answer
    
I have two server first server ip (10.0.0.12) or second server ip (10.0.0.25) on first server i want to run apache server such as running lms such as (10.0.0.12/lms) or i want my lms sql file should run from second server (10.0.0.25) I have install all LAMP services and it is running perfectly but i am unable to connect mysql from second system. core should be run from first server and sql file access from second server. i don,t have knowledge about iptables guide me step my step. –  Abdul Kadir Mar 22 '12 at 13:43
    
Just follow the directions in the PHP manual pages. –  Ramhound Mar 22 '12 at 14:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.