LAMP介绍

lamp:Linux Apache mysql php/perl/python
Linux+Apache+Mysql/MariaDB+Perl/PHP/Python一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。

LAMP搭建

LAMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写:
1、Linux,操作系统
2、Apache,网页服务器
3、MariaDB或MySQL,数据库管理系统
4、PHP脚本语言

LAMP部署

1、安装软件包
[[email protected] ~]# yum -y install httpd mariadb mariadb-server php php-mysql
2、关闭防火墙,selinux,同时开启httpd,mariadb服务
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# setenforce 0
[[email protected] ~]# systemctl start httpd mariadb
3、在浏览器输入自己主机的ip测试是否成功
Centos:7——LAMP部署(Xshell操作)
4、在/etc/httpd/conf/下,修改httpd.conf文件,在164行添加index.php
[[email protected] ~]# vim /etc/httpd/conf/httpd.conf

Centos:7——LAMP部署(Xshell操作)
Centos:7——LAMP部署(Xshell操作)
5、在/var/www/html/下,新建index.php文件,写入相应内容
[[email protected] ~]# cd /var/www/html/
[[email protected] html]# vim index.php
Centos:7——LAMP部署(Xshell操作)
6、重启httpd服务,并在里浏览器中测试
[[email protected] html]# systemctl restart httpd
Centos:7——LAMP部署(Xshell操作)

到这里,LAMP架构便搭建成功了!如果后续要上线项目,在/var/www/html目录下上传相应项目包,同时创建相应数据库,授权项目用户即可!

相关文章: