仓酷云

标题: 给大家带来CentOS7下源码装置Apache2.4.9 [打印本页]

作者: 飘灵儿    时间: 2015-1-14 20:25
标题: 给大家带来CentOS7下源码装置Apache2.4.9
欢迎大家来到仓酷云论坛!1.筹办情况
centos7最小化装置
yum装置wget、vim、gcc、gcc-c++、cmake
2.装置apache2.4.10
官网:http://httpd.apache.org/
下载源码包:
cd/usr/loca/src
wgethttp://mirror.bit.edu.cn/apache//httpd/httpd-2.4.10.tar.gz
下载apache组件apr、apr-util:
wgethttp://mirror.bit.edu.cn/apache//httpd/httpd-2.4.10-deps.tar.gz
装置apr和apr-util:
tarzxvfhttpd-2.4.10-deps.tar.gz
cdhttpd-2.4.10/srclib/apr
./configure--prefix=/usr/local/apr
make&&makeinstall
cd../apr-util
./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr
下载装置zlib1.2.8
wgethttp://zlib.net/zlib-1.2.8.tar.gz
tarzxvfzlib-1.2.8.tar.gz
cdzlib-1.2.8
./configure--prefix=/usr/local/zlib
make&&makeinstall
下载装置pcre8.35
wgetftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
tarzxvfpcre-8.35.tar.gz
cdpcre-8.35
./configure--prefix=/usr/local/pcre
make&&makeinstall
下载openssl,装置apache2.4.9时提醒openssl版本太低,centos7自带版本openssl1.0.1e:
wgethttp://www.ckuyun.com/source/openssl-1.0.1h.tar.gz
不卸载体系自带openssl,间接源码编译openssl1.0.1h
tarzxvfopenssl-1.0.1h.tar.gz
cdopenssl-1.0.1h
./configure--prefix=/usr/local/openssl
make&&makeinstall
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
tarzxvfhttpd-2.4.9.tar.gz
cdhttpd-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
centos7利用systemctl取代chkconfig办理办事,防火墙也由iptables改换成了firewalld
起首用systemctl封闭防火墙:
systemctlstopfirewalld.service
systemctldisablefirewalld.service
开启apache办事器:
cd/usr/local/apache/bin
./apachectlstart
客户端扫瞄器上输出地点:
http://192.168.47.130/
看到页面显现Itworks!证实办事器已乐成启动
别的由于装置Apache办事器是选择装置了撑持openssl,特地研讨了一下怎样在apache中设置openssl
起首在/etc/httpd/http.conf文件中修正:
ServerName为www.ckuyun.com:80
往失落LoadModulessl_modulemodules/mod_ssl.so前的#号
往失落LoadModulesocache_shmcb_modulemodules/mod_socache_shmcb.so前的#号
往失落Include/etc/httpd/extra/httpd-ssl.conf前的#号
天生办事器证书:
1.天生办事器用的私钥文件server.key
opensslgenrsa-outserver.key1024
2.天生未签订的server.csr
opensslreq-new-keyserver.key-outserver.csr
步伐提醒输出一系列参数,包含国别、省名、市名。。。,依照提醒输出便可
3.签订办事器证书文件server.crt
opensslreq-x509-days365-keyserver.key-inserver.csr-outserver.crt
然后将天生的server.key、server.csr、server.crt拷贝到/etc/httpd目次下
/usr/local/apache/bin/apachectlrestart
扫瞄器会见:https://192.168.47.130,此时扫瞄器会提醒装置证书,装置后显现页面Itworks!,证实ssl模块已一般事情。
-----------------------------------
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!
作者: 再现理想    时间: 2015-1-16 17:45
标题: 给大家带来CentOS7下源码装置Apache2.4.9
对我们学习操作系统有很大的帮助,加深我们对OS的理解。?
作者: 精灵巫婆    时间: 2015-1-20 09:30
Linux是参照Unix思想设计的,理解掌握Linux必须按照Unix思维来进行。思想性的转变比暂时性的技术提高更有用,因为他能帮助你加快学习速度。
作者: 仓酷云    时间: 2015-1-29 06:29
即便是非英语国家的人发布技术文档,Linux也都首先翻译成英语在国际学术杂志和网络上发表。
作者: 透明    时间: 2015-2-6 00:32
如果你想深入学习Linux,看不懂因为文档实在是太难了。写的最好的、最全面的文档都是英语写的,最先发布的技术信息也都是用英语写的。
作者: 小妖女    时间: 2015-2-14 16:39
和私有操作系统不同,各个Linux的发行版本的技术支持时间都较短,这对于Linux初学者是往往不够的。
作者: 不帅    时间: 2015-3-4 09:03
Windows有MS-DOS?方式,在该方式下通过输入DOS命令来操作电脑;Linux与Windows类似,也有命令方式,Linux?启动后如果不执行?X-WINDOWS,就会处于命令方式下,必须发命令才能操作电脑。?
作者: 金色的骷髅    时间: 2015-3-11 18:10
任何一个叫做操作系统的东西都是这样子构成的:内核+用户界面+一般应用程序。
作者: 因胸联盟    时间: 2015-3-19 09:14
工具书对于学习者而言是相当重要的。一本错误观念的工具书却会让新手整个误入歧途。目前国内关于Linux的书籍有很多不过精品的不多。
作者: 简单生活    时间: 2015-3-27 20:24
随着实验课程的结束,理论课也该结束了,说实话教OS的这两位老师是我们遇到过的不错的老师(这话放这可能不太恰当).




欢迎光临 仓酷云 (http://www.ckuyun.com/) Powered by Discuz! X3.2