【发布时间】:2016-03-03 02:42:30
【问题描述】:
我对 linux 和 LAMP 设置非常陌生。我想在一台 linux 服务器上设置一个带有 AP 的 LAMP 环境,在另一台 linux 服务器上设置 M。我很难找到具有这种配置的相关文档。
到目前为止,我已经完成了以下步骤:
服务器1:
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
我将 /etc/httpd/conf/httpd.conf 中的 ServerName 更改为
#ServerName www.example.com:80
到
ServerName 172.32.35.14 (ip address of server1)
/sbin/service httpd restart
服务器2:
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
然后我有这些后期配置步骤:
在安装了我的 mysql 的服务器 2 上,我执行了以下操作:
bind-address = 172.32.35.14 (ip of server 1 where apache/php are installed)
service mysql restart
但我无法建立连接。您能否指出我所缺少的并请指导我。
【问题讨论】:
-
您确定没有与 iptables 相关的阻塞吗?另外,试试serverfaults
-
是的...我检查过..肯定没有与 iptables 相关的阻塞...
-
我在重新启动 mysqld 时看到以下错误 - service mysqld restart Stopping mysqld: [ OK ] MySQL Daemon failed to start。启动 mysqld:[失败]
-
我什至无法访问我的 apache 服务器...我尝试了 172.17.50.23...它只是说加载页面问题...好像我错过了什么
标签: php mysql linux apache lamp