标签:director 技术分享 emctl star 修改root密码 启动 lld water 输入
准备工作:安装wget
yum install -y wget
2、部署apache:
yum install -y httpd
systemctl start httpd
systemctl enable httpd
查看apache版本:
httpd -v
3、部署mysql(mariadb)
yum -y install wget
获取rpm软件包:
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
安装rpm包
rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装mysql
yum install -y mysql-community-server
启动
systemctl start mysql
systemctl enable mysql
修改root密码并设置允许远程连接
进入mysql
mysql -uroot
设置root密码为123456
set password for ‘root‘@‘localhost‘ =password(‘123456‘);
设置允许用root账户进行远程连接,并设置其密码为123456
grant all privileges on . to root@‘%‘identified by ‘123456‘;
修改的配置立即生效
flush privileges;
退出:
exit
查看mysql版本
mysql -V
5、部署php
yum install -y php
安装组件是php支持mysql
yum install -y \
php-mysql \
php-gd \
libjpeg* \
php-ldap \
php-odbc \
php-pear \
php-xml \
php-xmlrpc \
php-mbstring \
php-bcmath \
php-mhash
查看php版本
php --version
vi /etc/httpd/conf/httpd.conf
这行#去掉换成ServerName www.aa.com
在DirectoryIndex index.html这行最后面加上 index.php
vi /etc/php.ini
date.timezone = PRC //;去掉在等于号后面添加PRC//日期时区×××,
查看详细信息
vi /var/www/html/index.php
验证Apache支持php语言
<?php
phpinfo();
?>
浏览器输入:http://192.168.80.100
测试数据库工作是否正常-----
<?php
$link=mysql_connect(‘192.168.80.100‘,‘mail‘,‘123456‘);
if($link) echo "<h1>Success!!</h1>";
else echo "Fail!!";
mysql_close();
?>
mysql_secure_installation
y-n-y-y
systemctl restart mysql
刷新网页即可
标签:director 技术分享 emctl star 修改root密码 启动 lld water 输入
原文地址:http://blog.51cto.com/14158288/2337917