apache介绍
Apache是世界使用排名第一的Web服务器软件。它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一。它快速、可靠并且可通过简单的API扩充,将Perl/Python等解释器编译到服务器中。同时Apache音译为阿帕奇,是北美印第安人的一个部落,叫阿帕奇族,在美国的西南部。也是一个基金会的名称、一种武装直升机等等
操作系统版本
[[email protected] 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
[[email protected] src]#
获取链接
apache官方网址:www.apache.org
2.2源码包: http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz
2.4源码包: http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gz
apr: http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz
apr-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 gcc
yum -y install expat-devel
yum install -y pcre-devel
yum install -y libxml2-devel
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gz
wget apr: http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz
wget apr-util: https://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.gz
二:进行安装apr包,
[[email protected] apr-1.6.3]# ./configure --prefix=/usr/local/apr
[[email protected] apr-1.6.3]# echo $?
[[email protected] apr-1.6.3]# 0
[[email protected] apr-1.6.3]# make $$ install make
[[email protected] apr-1.6.3]# ls /usr/local/apr/
bin build-1 include lib
[[email protected] apr-1.6.3]#
三:安装apr-util包
[[email protected] src]# cd apr-util-1.6.1
[[email protected] apr-util-1.6.1]#
[[email protected] apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[[email protected] apr-util-1.6.1]# echo $?
[[email protected] apr-util-1.6.1]# 0
[[email protected] apr-util-1.6.1]#make
[[email protected] apr-util-1.6.1]#echo $?
[[email protected] apr-util-1.6.1]#make install
[[email protected] apr-util-1.6.1]# ls /usr/local/apr-util/
bin include lib
[[email protected] apr-util-1.6.1]#
四:安装apache(http)
[[email protected] src]#
[[email protected] src]# cd httpd-2.4.29/
[[email protected] 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
[[email protected] httpd-2.4.29]# echo $?
[[email protected] httpd-2.4.29]# make
[[email protected] httpd-2.4.29]# echo $?
[[email protected] httpd-2.4.29]# make install
五:开启apache
/usr/local/apache2.4/bin/apachectl start
PS:如果在启动过程中遇到错误的话 参考 下面的链接
http://blog.csdn.net/zhaomininternational/article/details/42293511
检测端口
[[email protected] 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 start
daemon 34739 0.0 0.8 360364 4248 ? Sl 02:30 0:00 /usr/local/apache2.4/bin/httpd -k start
daemon 34740 0.0 0.8 360364 4248 ? Sl 02:30 0:00 /usr/local/apache2.4/bin/httpd -k start
daemon 34741 0.0 0.8 360364 4248 ? Sl 02:30 0:00 /usr/local/apache2.4/bin/httpd -k start
root 34824 0.0 0.1 112676 984 pts/0 S+ 02:30 0:00 grep --color=auto http
[[email protected] conf]#
查看所加载的模块
[[email protected] 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)
[[email protected] conf]#
原文地址:http://blog.51cto.com/sdwaqw/2073748