1.准备环境

centos7最小化安装

yum安装wget、vim、gcc、gcc-c++、cmake

2.安装apache2.4.10

官网:http://httpd.apache.org/

下载源码包:

cd /usr/loca/src

wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.10.tar.gz

下载apache组件apr、apr-util:

wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.10-deps.tar.gz

安装apr和apr-util:

tar zxvf httpd-2.4.10-deps.tar.gz

cd httpd-2.4.10/srclib/apr

./configure --prefix=/usr/local/apr

make && make install

cd ../apr-util

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

下载安装zlib1.2.8

wget http://zlib.net/zlib-1.2.8.tar.gz

tar zxvf zlib-1.2.8.tar.gz

cd zlib-1.2.8

./configure --prefix=/usr/local/zlib

make && make install

下载安装pcre8.35

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz

tar zxvf pcre-8.35.tar.gz

cd pcre-8.35

./configure --prefix=/usr/local/pcre

make && make install

下载openssl,安装apache2.4.9时提示openssl版本过低,centos7自带版本openssl1.0.1e:

wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz

不卸载系统自带openssl,直接源码编译openssl1.0.1h

tar zxvf openssl-1.0.1h.tar.gz

cd openssl-1.0.1h

./configure --prefix=/usr/local/openssl

make && make install

mv /usr/bin/openssl /usr/bin/openssl.1.0.1e

ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

安装httpd2.4.9:

cd /usr/local/src

tar zxvf httpd-2.4.9.tar.gz

cd httpd-2.4.9

./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-cgi --enable-ssl --enable-rewrite --with-ssl=/usr/local/openssl --with-pcre=/usr/local/pcre --with-z=/usr/local/zlib --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl=/usr/local/openssl --enable-modules=most --enable-mpms-shared=all --with-mpm=event
make && make install
centos7使用systemctl代替chkconfig管理服务,防火墙也由iptables更换成了firewalld 首先用systemctl关闭防火墙: systemctl stop firewalld.service systemctl disable firewalld.service 开启apache服务器: cd /usr/local/apache/bin ./apachectl start 客户端浏览器上输入地址: http://192.168.47.130/ 看到页面显示It works!证明服务器已成功启动 另外因为安装Apache服务器是选择安装了支持openssl,顺便研究了一下如何在apache中配置openssl 首先在/etc/httpd/http.conf文件中修改: ServerName为www.example.com:80 去掉LoadModule ssl_module modules/mod_ssl.so前的#号 去掉LoadModule socache_shmcb_module modules/mod_socache_shmcb.so前的#号 去掉Include /etc/httpd/extra/httpd-ssl.conf前的#号 生成服务器证书: 1.生成服务器用的私钥文件server.key openssl genrsa -out server.key 1024 2.生成未签署的server.csr openssl req -new -key server.key -out server.csr 程序提示输入一系列参数,包括国别、省名、市名。。。,按照提示输入即可 3.签署服务器证书文件server.crt openssl req -x509 -days 365 -key server.key -in server.csr -out server.crt 然后将生成的server.key、server.csr、server.crt拷贝到/etc/httpd目录下 /usr/local/apache/bin/apachectl restart 浏览器访问:https://192.168.47.130,此时浏览器会提示安装证书,安装后显示页面It works!,证明ssl模块已正常工作。
---------------------------------------------------------------------------------------------------------------
http://www.centoscn.com/apache/2014/0727/3364.html

CentOS7 apache的更多相关文章

  1. centos7 apache httpd安装和配置django项目

    一.安装httpd服务 apache在centos7中是Apache HTTP server.如下对httpd的解释就是Apache HTTP Server.所以想安装apache其实是要安装http ...

  2. 如何搭建lamp(CentOS7+Apache+MySQL+PHP)环境 [转]

    在网上搜资料,自己在本地虚拟机上尝试搭建,弄了整整一天一夜,终于弄好了.网上的资料,虽然很多,但大多都是重复的,拿去试了之后,又很多都不能得到正确的结果.最终找到了适合我的linux环境的搭建方式;在 ...

  3. 如何搭建lamp(CentOS7+Apache+MySQL+PHP)环境

    我的环境:虚拟机是:VMware-workstation-full-8.0.0-471780.exe:Linux系统用的是:CentOS-7-x86_64-Minimal-1503-01.ios;(阿 ...

  4. CentOS7+Apache+MySQL+PHP环境

    Apache 1.安装Apache:yum -y install httpd 2.开启apache服务:systemctl start httpd.service 3.设置apache服务开机启动:s ...

  5. centos7+apache+svn配置 踩坑,注意权限问题。apache应用目录checkout应用 必须用这个命令:svn co file:///home/svn/test/ test ,通过svn add * &&commit 及任意修改都是不行的

    阅读帮助 命令提示符 [root@server-002 ~]# 表示当前服务root用户执行的命令 [svn@server-002 ~]$ 表示普通用户svn执行的命令 [root@localhost ...

  6. centOS7 apache ssl证书安装配置

    背景说明:服务器是centOS7.4 七牛申请的免费ssl证书 默认apache是没有安装SSL模块的,所以需要安装,接着使用命令: yum install -y mod_ssl apache目录 / ...

  7. CentOS7 Apache的安装配置

    前些天安装了Nginx,为了好玩我就又安装Apache,Apache的安装还算顺利.在此做一下学习记录和经验分享. 一.安装httpd 1.先查看一下系统有没有已经安装了httpd的,如果啥都没查到, ...

  8. Linux Centos7 Apache 訪问 You don't have permission to access / on this server.

    折腾了非常久,今天才找到了最正确的答案.感言真不easy. 百度出来的99%都是採集的内容.全都是错误的. You don't have permission to access / on this ...

  9. centos7 apache 配置ssl

    因为小程序后台服务器需要是https的,所以这两天赶紧百度了一波什么是https以及怎么将服务器升级为https.虽然网上教程很多但因具体环境可能有差异导致一路遇坑,摸爬滚打了两天终于弄好了.遂记下一 ...

随机推荐

  1. set_time_limit

    语法 : void set_time_limit (int seconds)说明 : 设定一个程式所允许执行的秒数,如果到达限制的时间,程式将会传回错误.它预设的限制时间是30秒,max_execut ...

  2. bootstrap4.1下拉菜单

    <!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title> ...

  3. 分形之谢尔宾斯基(Sierpinski)三角形

    谢尔宾斯基三角形(英语:Sierpinski triangle)是一种分形,由波兰数学家谢尔宾斯基在1915年提出,它是一种典型的自相似集.也有的资料将其称之为谢尔宾斯基坟垛. 其生成过程为: 取一个 ...

  4. devexpress gridview 添加按钮

    #region 添加按钮事件 private RepositoryItemButtonEdit CreateRepositoryItemButtonEdit(Dictionary<object, ...

  5. 使用Charles对Android App的https请求进行抓包

    本文背景 公司新项目要求抓取目前市面上一些热门App的数据,经过研究发现很多App的网络请求都使用https进行数据传输,这样问题就来了,http使用明文传输所有请求都能拦截到,而https请求无法拦 ...

  6. DS博客作业03—栈和队列

    1.本周学习总结 本周学习了栈和队列两种数据结构,分别对应后进先出,先进先出两种数据操作 学会栈的特殊类型-共享栈,队列的特殊类型-循环队列的一系列操作 学会熟练使用栈和队列的STL容器,使代码简洁 ...

  7. 百度小程序button去掉默认边框

    百度小程序button去掉默认边框: button::after{ border:none; }

  8. AWD比赛常规套路

    作者:Leafer   本文属于Arctic shell原创内容计划文章,转载请注明原文地址! 比赛环境:纯净win10,最新版kali,securecrt或者WinSCP 在进入服务器后应进行的常规 ...

  9. maven项目无法新增java test目录的问题

    有时候当我们构建好maven项目时,再导入eclipse中会缺少src/main/java  和src/test/java,这是需要我们手动创建: 但是有时候在 项目视图下或者 enterprise ...

  10. Tools - 文本编辑器Notepad++

    00 - NotePad++ 官网 01 - Notepad++修改主题 依次点击设置---语言格式设置---选择主题,在显示界面中修改相关设置(背景色.前景色.字体等). 02 - Notepad+ ...