本文共 3595 字,大约阅读时间需要 11 分钟。
Apache是世界使用排名第一的Web服务器软件。它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一。它快速、可靠并且可通过简单的API扩充,将Perl/Python等解释器编译到服务器中。同时Apache音译为阿帕奇,是北美印第安人的一个部落,叫阿帕奇族,在美国的西南部。也是一个基金会的名称、一种武装直升机等等
[root@localhost src]# uname -a
Linux localhost.localdomain 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux[root@localhost src]#apache官方网址:www.apache.org2.2源码包: http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz2.4源码包: http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gzapr: http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gzapr-util: https://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.gz
PS:apr和apr-util是一个通用的函数库,它让httpd可以不关心底层的操作系统平台,可以方便移植(Linux移植到Windows)
apache安装条件:必须先安装gcc包、pcre包、apr与apr-util;
一:安装下列7个包yum -y install gccyum -y install expat-develyum install -y pcre-develyum install -y libxml2-develwget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gzwget apr: http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gzwget apr-util: https://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.gz
[root@localhost apr-1.6.3]# ./configure --prefix=/usr/local/apr
[root@localhost apr-1.6.3]# echo $?[root@localhost apr-1.6.3]# 0[root@localhost apr-1.6.3]# make $$ install make[root@localhost apr-1.6.3]# ls /usr/local/apr/bin build-1 include lib[root@localhost apr-1.6.3]#[root@localhost src]# cd apr-util-1.6.1
[root@localhost apr-util-1.6.1]# [root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr[root@localhost apr-util-1.6.1]# echo $?[root@localhost apr-util-1.6.1]# 0[root@localhost apr-util-1.6.1]#make[root@localhost apr-util-1.6.1]#echo $?[root@localhost apr-util-1.6.1]#make install[root@localhost apr-util-1.6.1]# ls /usr/local/apr-util/bin include lib[root@localhost apr-util-1.6.1]#[root@localhost src]#
[root@localhost src]# cd httpd-2.4.29/[root@localhost httpd-2.4.29]# ./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most[root@localhost httpd-2.4.29]# echo $?[root@localhost httpd-2.4.29]# make[root@localhost httpd-2.4.29]# echo $?[root@localhost httpd-2.4.29]# make install/usr/local/apache2.4/bin/apachectl start
PS:如果在启动过程中遇到错误的话 参考 下面的链接[root@localhost conf]# ps aux |grep httpd
root 34738 0.0 0.4 71400 2136 ? Ss 02:30 0:00 /usr/local/apache2.4/bin/httpd -k startdaemon 34739 0.0 0.8 360364 4248 ? Sl 02:30 0:00 /usr/local/apache2.4/bin/httpd -k startdaemon 34740 0.0 0.8 360364 4248 ? Sl 02:30 0:00 /usr/local/apache2.4/bin/httpd -k startdaemon 34741 0.0 0.8 360364 4248 ? Sl 02:30 0:00 /usr/local/apache2.4/bin/httpd -k startroot 34824 0.0 0.1 112676 984 pts/0 S+ 02:30 0:00 grep --color=auto http[root@localhost conf]#[root@localhost conf]# /usr/local/apache2.4/bin/httpd -M
Loaded Modules:core_module (static)so_module (static)http_module (static)mpm_event_module (static)authn_file_module (shared)authn_core_module (shared)authz_host_module (shared)authz_groupfile_module (shared)authz_user_module (shared)authz_core_module (shared)access_compat_module (shared)auth_basic_module (shared)reqtimeout_module (shared)filter_module (shared)mime_module (shared)log_config_module (shared)env_module (shared)headers_module (shared)setenvif_module (shared)version_module (shared)unixd_module (shared)status_module (shared)autoindex_module (shared)dir_module (shared)alias_module (shared)[root@localhost conf]#转载于:https://blog.51cto.com/sdwaqw/2073748