pradeep D's picture

I am pretty new to the scenario of LAMP. I am trying to create a multiple server lamp stack i.e. 3 linux servers with one of A,M,P (Linux+ Apache, Linux + Mysql, Linux + php)

I have my basic environment ready with 3 linux servers having A,M,P respectively. But I am having troubles integrating the 3 (A,M,P) to communicate with each other. Has anyone tried one such scenario. Or any guidelines for the same. Searched on the net but couldnt find any. These are the steps I followed. I am missing the steps to integrate all the 3. Please guide

 

server1:

yum install -y httpd
/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

server 3:
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

Forum: 
Jeremy Davis's picture

We are a Debian based virtual machine library... And it looks like you are using Red Hat (or a derivative such as CentOS) so this is probably not the best place for specific help on your issue. I suggest that you post on the community forums related to the OS that you are using. And/or post on a general Linux forum...

Regardless; AFAIK you will need to run PHP & Perl on the same server as Apache (if you want them served online). Having MySQL on a separate server should be ok though.

OTOH if you want to give TurnKey a spin (and are happy to get your head around the difference between Debian based distros and Red Hat based ones) then we have a pre-configured LAMP stack appliance. It has MySQL included but you can easily remove that and use our pre-configured MySQL appliance as your second server. You won't need to "connect them" as such; you'll just need to configure the web app(s) that you are serving to use the remote MySQL appliance for it's DB...

Add new comment