概述
xampp是一个可靠的稳定的 LAMP 套件,目前已被诸多公司用于生产服务器的部署,目前Lepus的开发环境,测试环境以及线上官网的WEB环境,都是运行在 XAMPP 环境下面,并且一直都是稳定的。下面介绍下在centos7环境下安装部署xampp的教程。
1、安装Xampp
# chmod u+x xampp-linux-x64-7.2.19-2-installer.run # ./xampp-linux-x64-7.2.19-2-installer.run
一直next
2、修改配置
2.1.如果 远程访问 xampp报下面错误
Access forbidden! New XAMPP security concept: Access to the requested object is only available from the local network. This setting can be configured in the file "httpd-xampp.conf".
注释掉下面一行
# vim extra/httpd-xampp.conf #Require local
2.2.配置启用虚拟目录
打开下面的注释
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
2.3.默认WEB代码上传目录:
/opt/lampp/htdocs/
3、配置环境变量
# vi /etc/profile
export PATH=$PATH:/opt/lampp/ bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/lampp/lib
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/opt/lampp/include
#source /etc/profile
4、启动LAMP
# /opt/lampp/lampp start
Starting XAMPP for Linux 5.5.38-3...
XAMPP: Starting Apache...ok.
XAMPP: Starting mysql ...ok.
XAMPP: Starting ProFTPD...ok.
PS:lampp命令支持stop、status、start、 restart 命令。
让xampp开机自动启动
$ ln -s /opt/lampp/lampp /etc/init.d/lampp $ chkconfig --add lampp
5、XAMPP组件配置
# httpd 主配置文件; /opt/lampp/etc/httpd.conf # PHP主配置文件; /opt/lampp/etc/php.ini # MariaDB 主配置文件; /opt/lampp/etc/my.cnf # MariaDB数据目录; /opt/lampp/ var /mysql # 所有日志目录; /opt/lampp/logs/
篇幅有限,这块内容就介绍到这了,其实也可以命令行安装的,只是我这边自动调出来图形而已,所以就用了 图形界面 安装。后面会分享更多 devops 和DBA方面的内容,感兴趣的朋友可以关注一下~