CentOS7上搭建WEB服务器
mysql
安装 直接yum install mysql-server是不可以的
1 wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
2 rpm -ivh mysql-community-release-el7-5.noarch.rpm
3 yum install mysql-server
修改密码
update user set password=password(‘123456‘) where user=‘root‘;
update user set authentication=password(‘123456‘) where user=‘root‘;
修改远程连接权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
flush privileges;
exit
service mysqld restart
防火墙
开放端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效,没有此参数重启后失效
--list-all
关闭及禁止开机启动
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
apache
yum install httpd
php
yum install php
yum install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash