搭建lamp环境
2017-01-09 14:37
197 查看
一、配置防火墙
CentOS 7.0默认使用的是firewall作为防火墙。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注释掉
SELINUX=disabled #增加
:wq! #保存退出
setenforce 0 #使配置立即生效
3.安装apache
yum install httpd #根据提示,输入Y安装即可成功安装
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动
4.安装mariadb(mysql)
yum install mariadb mariadb-server #询问是否要安装,输入Y即可自动安装,直到安装完成
systemctl start mariadb.service #启动MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重启MariaDB
systemctl enable mariadb.service #设置开机启动
5、安装PHP以及组件,使PHP支持 MariaDB
进入目录,测试一下
cd /var/www/html
vi index.php #输入下面内容
<?php
phpinfo();
?>
:wq! #保存退出
CentOS 7.0默认使用的是firewall作为防火墙。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注释掉
SELINUX=disabled #增加
:wq! #保存退出
setenforce 0 #使配置立即生效
3.安装apache
yum install httpd #根据提示,输入Y安装即可成功安装
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动
4.安装mariadb(mysql)
yum install mariadb mariadb-server #询问是否要安装,输入Y即可自动安装,直到安装完成
systemctl start mariadb.service #启动MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重启MariaDB
systemctl enable mariadb.service #设置开机启动
5、安装PHP以及组件,使PHP支持 MariaDB
yum install php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash #这里选择以上安装包进行安装,根据提示输入Y回车 systemctl restart mariadb.service #重启MariaDB systemctl restart httpd.service #重启apache
进入目录,测试一下
cd /var/www/html
vi index.php #输入下面内容
<?php
phpinfo();
?>
:wq! #保存退出
相关文章推荐
- [LAMP] Red.Hat.Linux.9.0下搭建LAMP环境
- CENTOS5.1上搭建LAMP环境
- Linux|UNIX下LAMP环境的搭建及常见问题[连载2]
- Linux|UNIX下LAMP环境的搭建及常见问题[连载7]
- Linux|UNIX下LAMP环境的搭建及常见问题[连载6]
- [原创] LAMP测试环境搭建
- Fedora 11 的安装以及 LAMP环境的搭建(二)
- LAMP环境搭建
- 搭建LAMP环境(三)
- Linux|UNIX下LAMP环境的搭建及常见问题[连载10]
- lamp环境搭建
- lamp环境的基本搭建
- UBUNTU下LAMP环境的搭建
- Linux|UNIX下LAMP环境的搭建及常见问题[连载1]
- LAMP环境搭建+实例
- LAMP环境搭建 推荐
- 如何搭建LAMP环境
- 精简LAMP环境搭建
- Linux|UNIX下LAMP环境的搭建及常见问题[连载4]