阿里云centos7.2 centos 超全lamp 环境搭建 (各类拼接:))

一、安装apachephp

1.安装mysql

yum -y install httpdweb

2.开启apache服务sql

systemctl start httpd.service数据库

3.设置apache服务开机启动apache

systemctl enable httpd.service安全

使用公网访问能看到apache就说明安装成功php7

 

二、安装php7tcp

1.安装php7ide

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

2. 经过云进行php和其余组件的安装

yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64

yum install php70w-fpm

三、安装mysql

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
查看
yum repolist enabled | grep "mysql.*-community.*"
安装mysql
yum -y install mysql-community-server
开机启动
systemctl enable mysqld
启动mysql服务
systemctl start mysqld
远程访问

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'MyPassword' WITH GRANT OPTION;

FLUSH PRIVILEGES; 

 

四、防火墙

一、firewalld的基本使用

启动: systemctl start firewalld
查看状态: systemctl status firewalld 
中止: systemctl disable firewalld
禁用: systemctl stop firewalld
添加
firewall-cmd  --zone=public --add-port=80/tcp --permanent
删除
firewall-cmd  --zone= public --remove-port=80/tcp --permanent
最后必定要在阿里云安全组里添加mysql规则
修改数据库密码 参考网址 http://blog.csdn.net/qq_28347599/article/details/71915209
 
 
隐藏index.php
在APACHE里面去配置 ,将里面的AllowOverride None都改成AllowOverride All
 
删除mysql,php
rpm -qa | grep php 查看php
rpm -qa|grep -i mysql 查看mysql
yum remove mysql 删除mysql
rpm -e php-fpm-5.3.3-22.el6.x86_64 删除php ,删除mysql同样
相关文章
相关标签/搜索