80.LAMP中的apache安装
apache介绍Apache是世界使用排名第一的Web服务器软件。它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一。它快速、可靠并且可通过简单的API扩充,将Perl/Python等解释器编译到服务器中。同时Apache音译为阿帕奇,是北美印第安人的一个部落,叫阿帕奇族,在美国的西南部。也是一个基金会的名称、一种武装直升机等等
操作系统版本
# 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
#
获取链接
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
wgethttp://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包,
# ./configure --prefix=/usr/local/apr
# echo $?
# 0
# make $$ install make
# ls /usr/local/apr/
binbuild-1includelib
#
三:安装apr-util包
# cdapr-util-1.6.1
#
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# echo $?
# 0
#make
#echo $?
#make install
# ls /usr/local/apr-util/
binincludelib
#
四:安装apache(http)
#
# cd 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
# echo $?
# make
# echo $?
# make install
五:开启apache
/usr/local/apache2.4/bin/apachectl start
PS:如果在启动过程中遇到错误的话 参考 下面的链接
http://blog.csdn.net/zhaomininternational/article/details/42293511
检测端口
# ps aux |grep httpd
root 347380.00.4714002136 ? Ss 02:30 0:00 /usr/local/apache2.4/bin/httpd -k start
daemon 347390.00.8 3603644248 ? Sl 02:30 0:00 /usr/local/apache2.4/bin/httpd -k start
daemon 347400.00.8 3603644248 ? Sl 02:30 0:00 /usr/local/apache2.4/bin/httpd -k start
daemon 347410.00.8 3603644248 ? Sl 02:30 0:00 /usr/local/apache2.4/bin/httpd -k start
root 348240.00.1 112676 984 pts/0 S+ 02:30 0:00 grep --color=auto http
#
查看所加载的模块
# /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)
#
页:
[1]