0

I am pretty new to linux and LAMP setup. I want to setup a LAMP environment with AP on one linux server and M on a different linux server. I have a hard time finding a relevant document with such a configuration.

I have done the following steps so far:

server1:

yum install -y httpd
/sbin/service httpd restart
yum install -y php php-mysql
sed -i "s/Listen 80/#Listen 80/g" /etc/httpd/conf/httpd.conf
yum install -y mod_ssl openssl
/sbin/service httpd restart
service iptables stop

I changed the ServerName in /etc/httpd/conf/httpd.conf from

#ServerName www.example.com:80

to

ServerName 172.32.35.14 (ip address of server1)
/sbin/service httpd restart

server2:

yum install -y mysql-libs
yum install -y mysql
yum install -y perl-DBI
yum install -y perl-DBD-MySQL
yum install -y mysql-server
/sbin/chkconfig mysqld on
/sbin/service mysqld start
mysql -u root  -e "CREATE USER 'mysqluser' IDENTIFIED by 'password'" 
mysql -u root  -e "CREATE USER 'mysqluser'@'localhost' IDENTIFIED by 'password'"
mysql -u root  -e "GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'localhost' WITH GRANT OPTION"
mysql -u root  -e "GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'%' WITH GRANT OPTION"
mysql -u mysqluser -p password -e "CREATE DATABASE mysqldb" 
mysql -u mysqluser -p password mysqldb < /tmp/mysqlinstaller/world.sql
service iptables stop

Then I had these post configuration steps:

On server 2, where my mysql is installed, I did the following in /etc/my.cnf under the tag [mysqld]

bind-address = 172.32.35.14 (ip of server 1 where apache/php are installed)
service mysqld restart

service mysqld start
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

I am facing these issues...

  1. When I run the url http://172.32.35.14 on my browser to check the apache installation, I am not able to get the default apache homepage. Instead it says Problem loading page.

  2. When I run - service mysqld restart - on the server where mysql is installed, I get the following error:

    service mysqld start MySQL Daemon failed to start. Starting mysqld: [FAILED]

Can you point out what I am missing and guide me please

marked as duplicate by Florin Asăvoaie, MadHatter, EEAA linux Nov 29 '15 at 13:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    First of all, you should always check your error logs, they will already give you a better view of what went wrong. Post the relevant lines here. One thing I can see from a distance is that you're using an IP address when you should be using a hostname. httpd.apache.org/docs/2.0/mod/core.html#servername – vic Nov 29 '15 at 13:32
  • Please do not post duplicate questions. – EEAA Nov 29 '15 at 13:56
  • Apologies.. my bad.. Heights of desperation. Im extremely sorry – pradeep Nov 29 '15 at 13:58
1

bind-address is the IP of the MySQL server.

http://172.32.35.14 would load from http/port 80 which you disabled. Use https.

I think I will also vote to move the question to the superuser site, this is not a professional question.

  • I tried with https too.. Still the same issue. I enabled the port 80 and tried http... I disabled it and tried https... I enabled 443 and tried https.. I tried all permutations – pradeep Nov 29 '15 at 13:42
  • enabled the port 80 and gave the ServerName 172.32.35.14. I have a sample info.php with the following code <?php phpinfo(); ?> inside. Changed the permissions to 777 and tried to access 172.32.35.14/info.php. But in vain. Problem loading page :( – pradeep Nov 29 '15 at 15:38

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