一键搭建lamp(apache2.2+mysql5.1+php5.3)(centos6.6和red6.5)
如果对运维课程感兴趣,可以在b站上、csdn或微信视频号 上搜索我的账号: 运维实战课程,可以关注我,学习更多免费的运维实战技术视频
在192.168.37.128服务器上搭建lamp平台(apache2.2+mysql5.1+php5.3)
1.上传各个安装包:
[root@localhost ~]# mkdir /apache
[root@localhost ~]# mkdir /mysql
[root@localhost ~]# mkdir /php
[root@localhost ~]# ls /apache/
httpd-2.2.31.tar.gz
[root@localhost ~]# ls /mysql/
mysql-5.1.72.tar.gz
[root@localhost ~]# ls /php/
libiconv-1.14.tar.gz php-5.3.27.tar.gz
2.开发一键安装lamp脚本:
[root@localhost ~]# cat a.sh
#!/bin/bash
LANG=en_US.UTF-8
#安装apache2.2.31(单网站域名,在默认站点目录htdocs中) (适合red6.5和cent6.6)
cd /apache/
rpm -q gcc ||yum -y install gcc
rpm -q gcc-c++ || yum -y install gcc-c++
rpm -q zlib || yum -y install zlib
rpm -q zlib-devel || yum -y install zlib-devel
useradd apache -s /sbin/nologin -M
tar -zxf httpd-2.2.31.tar.gz
cd httpd-2.2.31
./configure --prefix=/usr/local/apache \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-modules=most \
--enable-so \