文章来源:http://www.cnblogs.com/hello-tl/p/7568803.html
更新时间:2017-09-21 15:38
简介
LAMP+R指Linux+Apache+Mysql+PHP+Redis是一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。
Apache 安装篇 Demo地址:http://www.cnblogs.com/hello-tl/articles/7568803.html
Php 安装篇 Demo地址:http://www.cnblogs.com/hello-tl/p/7569071.html
Mysql 安装篇 Demo地址:http://www.cnblogs.com/hello-tl/p/7569097.html
Redis 安装篇 Demo地址:http://www.cnblogs.com/hello-tl/p/7569108.html
0、yum 安装依赖和工具
1
|
# yum install cmake gcc-c++ ncurses-devel perl-Data-Dumper boost-doc boost-devel
|
1.下载apache安装包 以及依赖
1
2
3
4
|
# wget http:
//apache.fayea.com/httpd/httpd-2.4.26.tar.gz
# wget http:
//archive.apache.org/dist/apr/apr-1.5.2.tar.gz
# wget http:
//archive.apache.org/dist/apr/apr-util-1.5.2.tar.gz
# wget ftp:
//ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
|
如果以上有地址报错404
小田百度网盘下载软件包地址
httpd-2.4.26.tar.gz 密码: udtk
apr-1.5.2.tar.gz 密码: nwap
apr-util-1.5.2.tar.gz 密码: c4y8
pcre-8.39.tar.gz 密码: ut53
2.下载apache安装包 以及依赖
1
2
3
4
|
# tar -zxvf httpd-2.4.26.tar.gz
# tar -zxvf apr-1.5.2.tar.gz
# tar -zxvf apr-util-1.5.2.tar.gz
# tar -zxvf pcre-8.39.tar.gz
|
3.apr-1.5.2 和 apr-util-1.5.2 去掉版本号
1
2
|
# mv apr-util-1.5.2 apr-util
# mv apr-1.5.2 apr
|
4.吧apr 和 apr-util 放入 httpd-2.4.26/srclib的目录
1
|
# mv apr apr-util httpd-2.4.26/srclib
|
5.安装pcre
1
2
3
4
|
# cd pcre-8.39
# ./configure --prefix=/home/pcre
//prefix 安装目录
# make && make install
|
6.编译安装apache
1
2
3
4
5
6
7
8
9
10
11
12
|
# cd httpd-2.4.26
# ./configure --prefix=/home/apache \
--with-pcre=/home/pcre/bin/pcre-config \
--enable-module=shared \
--enable-modules=most \
--enable-modules=all \
--with-included-apr \
--enable-so \
--enable-rewrrite \
--enable-dav \
--with-zlib \
--enable-maintainer-mode
|
/**
* ./configure --prefix= 安装目录
* --with-pcre= pcre的安装路径
* --with-ssl 证书
* --with-zlib 提供数据压缩用的函式库
* --enable-maintainer-mode 关闭缺省时仅供程序维护者使用的makefile目标
* --enable-module=shared shared=要加上后面的参数否则无法使用php ,表示Apache可以动态的加载模块将模块编译到apache当中
* --enable-modules=most 模块编译到apache当中
* --enable-modules=all 模块编译到apache当中
* --enable-so 让apache核心装在DSO
* --enable-rewrite 启动重写功能
* --enable-dav apache支持svn
*/
1
|
# make && make install
|
7.检查是否安装成功
1
2
|
# cd /home/apache/bin/
# ./apachectl -k start
|
启动 start
停止 stop
重启 restart
8.防火墙设置
1
2
3
4
5
6
|
//开启防火墙
# systemctl start firewalld
//开启80端口
# firewall-cmd --zone=
public
--add-port=80/tcp --permanent
//重启防火墙
# systemctl restart firewalld.service
|
9.查看apache是否开启
1
|
# ps aux | grep httpd
|
浏览器下输入IP地址验证