apache一键安装脚本
2016-01-05 11:24
555 查看
近期在玩apache,首先安装apace要配置apr。apr-util,pcre,而配置这些基本都是千篇一律。所谓程序猿的精神就是降低反复性的劳动,以下请看我写的apache安装脚本:
这个脚本我也放到我的github上
这个脚本我也放到我的github上
#!/bin/bash # 须要sudo运行 dir=`pwd` #要安装pcre先要安装 g++ if [[ `ls /etc|grep redhat-release` != "" ]] then yum -y install gcc gcc-c++ elif [[ `ls /etc|grep debian_version` != "" ]] then apt-get -y install gcc gcc-c++ fi if [[ `ls|grep apr` == "" ]] then wget http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz fi tar -zxvf apr-1.5.2.tar.gz mkdir /usr/local/lib/apr-1.5.2 cd $dir/apr-1.5.2 ./configure --prefix=/usr/local/lib/apr-1.5.2 make make install cd $dir if [[ `ls|grep apr-util` == "" ]] then wget http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.4.tar.gz fi tar -zxvf apr-util-1.5.4.tar.gz mkdir /usr/local/lib/apr-util-1.5.4.tar.gz cd $dir/apr-util-1.5.4 ./configure --prefix=/usr/local/lib/apr-util-1.5.4 --with-apr=/usr/local/lib/apr-1.5.2 make make install cd $dir if [[ `ls|grep pcre` == "" ]] then wget http://ncu.dl.sourceforge.net/project/pcre/pcre/8.37/pcre-8.37.tar.gz fi tar -zxvf pcre-8.37.tar.gz mkdir /usr/local/lib/pcre-8.37 cd $dir/pcre-8.37 ./configure --prefix=/usr/local/lib/pcre-8.37 make make install cd $dir if [[ `ls|grep httpd` == "" ]] then wget http://www.apache.org/dist/httpd/httpd-2.4.12.tar.gz fi tar -zxvf httpd-2.4.12.tar.gz mkdir /usr/local/lib/httpd-2.4.12 cd $dir/httpd-2.4.12 ./configure --prefix=/usr/local/lib/httpd-2.4.12 --with-apr=/usr/local/lib/apr-1.5.2 --with-apr-util=/usr/local/lib/apr-util-1.5.4 --with-pcre=/usr/local/lib/pcre-8.37 --enable-so make make install #解决httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message sed -i 's/^#ServerName www.example.com:80/ServerName localhost/g' /usr/local/lib/httpd-2.4.12/conf/httpd.conf /usr/local/lib/httpd-2.4.12/bin/apachectl start #启动apache if [[ `curl -s localhost:80|grep "It works"` != "" ]] then echo "----------------------成功安装-------------------------------------" cd $dir rm -rf apr-1.5.2/ apr-util-1.5.4/ pcre-8.37/ httpd-2.4.12/ fi
相关文章推荐
- 搭建PHP环境LAMP(Linux+Apache+MySQL+PHP)
- Apache JMeter是
- mybatis报错nested exception is org.apache.ibatis.binding.BindingException: Parameter 'idList' not foun
- 单机创建Glassfish集群(apache jk)
- windows下创建apache服务
- Apache Stratos探究:Pub-Sub 通信模式
- linux普通用户下安装apache、mysql、php
- Caused by: java.lang.ClassNotFoundException: org.apache.log4j.DefaultThrowableRenderer
- Apache编译安装
- Apache CXF 客户端调用 超时设置
- 关闭 Apache—DBUtils框架简介、DbUtils类、QueryRunner类 、ResultSetHandler接口
- Ubuntu下Apache中部署Django
- Apache cxf 整合 Spring MVC
- [转]五种开源协议的比较(BSD,Apache,GPL,LGPL,MIT)
- Apache James邮件服务器的简介及使用
- Apache无法启动解决方案
- Apache cloudera hortonworks 与cdh ambari cm hdp hadoop生态圈的关系
- Apache添加mime类型
- 四大开源协议:BSD、Apache、GPL、LGPL
- apache+php+mysql安装配置