apache2.4脚本一键安装(linux环境)
1.下载apache安装包和相关组件
下载地址:https://pan.baidu.com/s/1o85i6Jw
其中包括
apache安装包:httpd-2.4.29.tar.gz
apache安装所需其他模块:apr-1.6.3.tar.gz、apr-util-1.6.1.tar.gz、pcre-8.41.tar.gz
apache一键安装脚本:install_apache24.sh
2.安装准备
root身份登录,创建安装文件上传目录
# mkdir /installpkgs
上传以上下载的5个文件至该目录( /installpkgs)下
3.执行脚本
# cd /installpkgs
# chmod 755 install_apache24.sh
# sh install_apache24.sh
执行过程中会有3次yum下载安装其他软件 输入"y"回车即可
4.结果演示
执行完安装之后,确定防火墙已关闭或已开放80端口
关闭防火墙:
此次生效:# service iptables stop
重启后生效:# chkconfig iptables off
输入ip地址可以看到如下界面,说明apache安装成功,脚本就是这么几步,不然正常安装可能提示少了这些哪些模块什么的(apache2.4版本的没集成apr、apr-util、pcre模块,需要另行下载)

附:脚本说明
#!/bin/bash
#apr安装
tar -xvf /installpkgs/apr-1.6.3.tar.gz -C /installpkgs
cd /installpkgs/apr-1.6.3
./configure --prefix=/usr/local/apache2/installmodules/apr
make && make install #apr-util安装
yum install expat-devel
tar -xvf /installpkgs/apr-util-1.6.1.tar.gz -C /installpkgs
cd /installpkgs/apr-util-1.6.1
./configure --prefix=/usr/local/apache2/installmodules/apr-util --with-apr=/usr/local/apache2/installmodules/apr
make && make install #pcre安装
yum install -y gcc gcc-c++
tar -xvf /installpkgs/pcre-8.41.tar.gz -C /installpkgs
cd /installpkgs/pcre-8.41
./configure --prefix=/usr/local/apache2/installmodules/pcre
make && make install #mod_ssl
yum install openssl-devel #httpd安装
tar -xvf /installpkgs/httpd-2.4.29.tar.gz -C /installpkgs
cd /installpkgs/httpd-2.4.29
./configure \
--prefix=/usr/local/apache2 \ #apache安装目录
--sysconfdir=/etc/httpd24 \ #apache配置文件目录
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-pcre=/usr/local/apache2/installmodules/pcre \
--with-apr=/usr/local/apache2/installmodules/apr \
--with-apr-util=/usr/local/apache2/installmodules/apr-util \
--enable-modules=most \
--enable-mpms-shared=all \
--with-mpm=prefork
make && make install #修改ServerName
if ! grep "ServerName localhost:80" /etc/httpd24/httpd.conf
then
echo "ServerName localhost:80" >> /etc/httpd24/httpd.conf
fi #apache服务启动
/usr/local/apache2/bin/apachectl -k start
apache2.4脚本一键安装(linux环境)的更多相关文章
- LNMP1.3一键安装Linux环境,配置Nginx运行ThinkPHP3.2
LNMP1.3一键安装Linux环境,配置Nginx运行ThinkPHP3.2 你是否遇见过:安装LNMP1.3环境后,运行ThinkPHP 3.2,只能打开首页,不能访问控制器,报404错误. 按照 ...
- Shell脚本一键安装LNMP环境
https://sourceforge.net/projects/opensourcefile/files/ Nginx是一款高性能的HTTP和反向代理服务器.Nginx在反向代理,Rewrite规则 ...
- Linux一键安装web环境全攻略phpstudy版
此教程主要是应对阿里云Linux云服务器ecs的web环境安装,理论上不限于阿里云服务器,此教程对所有Linux云服务器都具有参考价值. 写这篇文章的目的:网上有很多关于Linux一键安装web环境全 ...
- Linux一键安装LNMP环境
Linux一键安装LNMP环境 官方地址:https://lnmp.org/. 参考安装步骤:https://lnmp.org/install.html. 一键安装可以选择mysql版本.php版本, ...
- 安装完Ubuntu后通过shell脚本一键安装软件
安装完Ubuntu后通过shell脚本一键安装软件 以下代码中#是单行注释 :<<! ! 是多行注释. 运行的时候需要把多行注释去掉. 比如把以下代码保存为install.sh, 那么在终 ...
- shell脚本一键安装mysql5.7.x
使用脚本一键安装mysql5.7.x,初始化数据库.启动数据库---- mysql版本号:源代码mysql5.7.10 linux版本号:centos6.5 x86_64 #!/bin/bash GR ...
- shell脚本一键安装mysql5.7.x(免安装版)
使用脚本一键安装mysql5.7.x,初始化数据库,启动数据库---- mysql版本:源码mysql5.7.10 linux版本:centos6.5 x86_64 #!/bin/bash GROUP ...
- legend2---lamp.sh一键安装lamp环境需要爬的坑
legend2---lamp.sh一键安装lamp环境需要爬的坑 一.总结 一句话总结: 1.要记得更改项目权限:chown -R apache:apache /data/www/default/网站 ...
- Centos 6.4上面用Shell脚本一键安装vsftpd
Centos 6.4上面用Shell脚本一键安装vsftpd install.sh #!/bin/bash if [ `uname -m` == "x86_64" ];then m ...
随机推荐
- devexpress v14.2.3 发布
补丁而已. New Major Features in 14.2 What's New in VCL Products 14.2 Breaking Changes To learn about bre ...
- 前端之css语法3
一 float属性 1 基本的浮动规则: block元素和inline元素在文档流中的排列方式. block元素通常被现实独立的一块,独占一行.多个block元素会各自新起一行,默认block预算宽度 ...
- 492. Construct the Rectangle
static int wing=[]() { std::ios::sync_with_stdio(false); cin.tie(NULL); ; }(); class Solution { publ ...
- 2018.08.15 bzoj3747: [POI2015]Kinoman(线段树)
传送门 简单题. 先不管时间复杂度看看怎么做. 对于一段区间[l,r],如果从右端加入一个数a[r+1],对这个区间有什么影响?显然如果区间中已经有了a[r+1]这个数就会产生-a[i+1]的影响,否 ...
- 多网卡下对ServerSocket以TCP协议绑定IP和端口的测试
一.引言:之前开发TCP协议的程序(C#里是Socket为主)都是基于主机上只有一个IP的,后来项目里涉及到了主机需要同时连接内外和外网的情况,在该主机上部署着一套WCS系统和一套WMS系统:WCS系 ...
- button设置边宽和圆角
UIButton *meifuButton = [UIButton buttonWithType:UIButtonTypeSystem]; [meifuButton setTit ...
- Tensorflow从源代码编译2
https://blog.csdn.net/qq_37674858/article/details/81095101 https://blog.csdn.net/yhily2008/article/d ...
- DagScheduler 和 TaskScheduler
DagScheduler 和 TaskScheduler 的任务交接 spark 调度器分为两个部分, 一个是 DagScheduler, 一个是 TaskScheduler, DagSchedule ...
- express4.X 笔记
express是node的web框架,更新频繁,3.X到4.X有了很大的改变.网上的例子,各种版本的都有,为了以后方便,现在重新认真看一遍4.X的API,统一以后的使用方法.在J2EE上落后了,在ex ...
- spring aop方式配置事务中的三个概念 pointcut advice advisor
AOP的3个关键概念 因为AOP的概念难于理解,所以在前面首先对Java动态代理机制进行了一下讲解,从而使读者能够循序渐进地来理解AOP的思想. 学习AOP,关键在于理解AOP的思想,能够使用AOP. ...