apache2.4安装需要安装吗

apache2.4.9安装及升级注意事项
apr和apr-util包含在Apache
httpd的发行源代码中,并且在绝大多数情况下使用都不会出现问题。当然,如果apr或apr-util的1.0或1.1版本已经安装在你的系统中了,则必须将你的apr/apr-util升级到1.2版本,或者将httpd单独分开编译。要使用发行源代码中自带的apr/apr-util源代码进行安装,你必须手动完成
# 编译和安装 apr 1.5.1
cd srclib/apr
./configure& --prefix=/usr/local/apr-httpd/
make install
# 编译和安装 apr-util apr-util-1.5.3
cd ../apr-util-1.5.3
./configure --prefix=/usr/local/apr-util/
--with-apr=/usr/local/apr-httpd/
make install
##安装apache2.4.9
cd httpd-2.4.9
./configure --prefix=/slview/apache&
--enable-rule=SHARED_CORE&
--enable-rule=SHARED_CHAIN&
--enable-module=so& --enable-module=most
--enable-shared=max
--with-apr=/usr/local/apr-httpd/&
--with-apr-util=/usr/local/apr-util/
如报如下这种错:
/slview/apache/include/apr_hooks.h:20:17: error: apu.h: No such
file or directory
可以把相关文件拷到:/slview/apache/include/ 如
&cp /opt/apr-util-1.5.3/include/*
/slview/apache/include/
再报这种错:
-1& -DRESIN_HOME="/slview/resin" -I../common
-g -O2 -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64
-DHAS_SOCK_TIMEOUT -DHAS_JVMTI&&
-DLINUX -D_REENTRANT -D_GNU_SOURCE& -g -O2
-pthread mod_caucho.c
mod_caucho.c: In function 'write_env':
mod_caucho.c:588: error: 'conn_rec' has no member named
'remote_ip'
mod_caucho.c:590: error: 'conn_rec' has no member named
'remote_ip'
mod_caucho.c:591: error: 'conn_rec' has no member named
'remote_addr'
mod_caucho.c: In function 'caucho_request':
mod_caucho.c:897: error: 'conn_rec' has no member named
'remote_ip'
make[2]: *** [mod_caucho.lo] 错误 1
则需要修改:/slview/resin/modules/c/src/apache2/mod_caucho.c
将其中有三处的remote_ip修改成client_ip,如果存在remote_addr也应修改成client_addr
2.2升到2.4时需要注意事项:
模块mod_authn_default, mod_authz_default,
mod_mem_cache已经移除,如果在2.2版本使用mod_mem_cache模块,在2.4中使用mod_cache_disk.
所有负载均衡实现已经移动到了单独的,自包含的mod_proxy子模块中,如mod_lbmethod_bybusyness.如果在配置文件中使用这些模块,可能需要进行编译和加载.
对BeOS,TPF和更老的平台,如A/UX,Next和Tandem的支持已经移除.
默认编译动态模块
默认只加载模块的一个基本子集,其它的被注释掉了
默认编译most模块设定
the “reallyall” module set adds developer modules to the “all”
apr和apr-util没有打包在httpd
2.4里面.你可以选择已经安装的版本或者下载apr和apr-util,然后解压apr/apr-util到./srclib目录,使用&with-included-apr参数进行编译
2.运行时配置变化
包含认证配置方面的显著变化和其它一些小变化,认证配置方面的变化在常见问题中讲.其它小变化包括:
MaxRequestsPerChild重命名为MaxConnectionsPerChild,描述更加准确.
MaxClients重命名为MaxRequestWorkers,描述更加准确.对于异步MPM,如event,最大客户端数量不等于工作线程数量.旧的名字仍然支持.
DefaultType设定项不再产生作用,如果你用了,只会产生一个警告,使用其它设置进行替换.
EnableSendfile现在默认关闭.
FileETag现在默认为”MTime Size” (without INode).
mod_log_config: ${cookie}C matches whole cookie names.
Previously any substring would match.
mod_dav_fs: The format of the DavLockDB file has changed for
systems with inodes. The old DavLockDB file must be deleted on
KeepAlive only accepts values of On or Off. Previously, any
value other than “Off” or “0&P was treated as “On”.
Directives AcceptMutex, LockFile, RewriteLock, SSLMutex,
SSLStaplingMutex, and WatchdogMutexPath have been replaced with a
single Mutex directive. You will need to evaluate any use of these
removed directives in your 2.2 configuration to determine if they
can just be deleted or will need to be replaced using Mutex.
mod_cache: CacheIgnoreURLSessionIdentifiers now does an exact
match against the query string instead of a partial match. If your
configuration was using partial strings, e.g. using sessionid to
match /someapplication/image.jsessionid=, then you
will need to change to the full string jsessionid.
mod_ldap: LDAPTrustedClientCert is now consistently a
per-directory setting only. If you use this directive, review your
configuration to make sure it is present in all the necessary
directory contexts.
mod_filter: FilterProvider syntax has changed and now uses a
boolean expression to determine if a filter is applied.
mod_include:
The #if expr element now uses the new expression parser. The
old syntax can be restored with the new directive
SSILegacyExprParser.
An SSI* config directive in directory scope no longer causes
all other per-directory SSI* directives to be reset to their
default values.
mod_charset_lite: The DebugLevel option has been removed in
favour of per-module LogLevel configuration.
mod_ext-filter: The DebugLevel option has been removed in
favour of per-module LogLevel configuration.
mod_ssl: CRL based revocation checking now needs to be
explicitly configured through SSLCARevocationCheck.
mod_substitute: The maximum line length is now limited to
mod_reqtimeout: If the module is loaded, it will now set some
default timeouts.
3.其它杂项
mod_autoindex: will now extract titles and display descriptions
for .xhtml files, which were previously ignored.
mod_ssl: The default format of the *_DN variables has changed.
The old format can still be used with the new LegacyDNStringFormat
argument to SSLOptions. The SSLv2 protocol is no longer
supported.
htpasswd now uses MD5 hash by default on all platforms.
The NameVirtualHost directive no longer has any effect, other
than to emit a warning. Any address/port combination appearing in
multiple virtual hosts is implicitly treated as a name-based
virtual host.
mod_deflate will now skip compression if it knows that the size
overhead added by the compression is larger than the data to be
compressed.
Multi-language error documents from 2.2.x may not work unless
they are adjusted to the new syntax of mod_include’s #if expr=
element or the directive SSILegacyExprParser is enabled for the
directory containing the error documents.
4.第三方模块
所有模块在加载前必须重新编译.
2.2升级2.4升级过程中的常见问题
在2.2升级2.4的时候,因为有一些模块没有用了,又新加了一些模块,因此可能提示错误。以下是常见错误的解决方法。
Startup errors(启动错误)
错误提示: &Invalid command
Invalid command 'User', perhaps misspelled or defined by
a module not included in the server configuration
解决办法: 加载模块:mod_unixd,在httpd.conf中添加:
LoadModule unixd_module
modules/mod_unixd.so
错误提示: &Invalid command
‘Require’
Invalid command 'Require', perhaps misspelled or defined
by a module not included in the server configuration
Invalid command 'Order', perhaps misspelled or defined
by a module not included in the server configuration
解决办法有两种:
第一种:加载兼容模块 mod_access_compat ,在 httpd.conf 中添加:
LoadModule access_compat_module
modules/mod_access_compat.so
第二种:更新配置文件到2.4版本的语法.
包括以下两步:
第一步:加载相应模块,在 httpd.conf 中添加:
LoadModule authz_core_module
modules/mod_authz_core.so
LoadModule authz_host_module
modules/mod_authz_host.so
第二步:修改配置文件语法,此处举几个例子:
Order deny,allow
Deny from all
Require all denied
Order allow,deny
Allow from all
Require all granted
Order Deny,Allow
Deny from all
Allow from example.org
<span STYLE="CoLor: #.4 版本:
Require host example.org
&&Ignoring deprecated use of
DefaultType
Ignoring deprecated use of DefaultType in line NN of
/path/to/httpd.conf
解决办法:移除 DefaultType
,使用其它配置设置.
在处理请求时的错误
&configuration error: couldn’t check user:
configuration error: couldn't check user:
解决办法:加载模块: mod_authn_core .
加载方法与上面讲的类似.
2.2升级2.4参考文章
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。Apache-2.4.x 编译安装方法_Linux教程_Linux公社-Linux系统门户网站
你好,游客
Apache-2.4.x 编译安装方法
来源:Linux社区&
作者:hcchanqing
apache-2.2与新出的apache-2.4安装不同的地方在于,2.4版的已经不自带apr库,所以在安装apache-2.4之前,需要下载apr。
1、下载软件
cd /tmpwget http://mirrors.axint.net/apache//httpd/httpd-2.4.2.tar.gzwget http://mirrors.axint.net/apache//apr/apr-1.4.6.tar.gzwget http://mirrors.axint.net/apache//apr/apr-util-1.4.1.tar.gztar xzf httpd-2.4.2.tar.gztar xzf apr-1.4.6.tar.gztar xzf apr-util-1.4.1.tar.gz
2、移动apr到srclib
mv apr-1.4.6 httpd-2.4.2/srclib/aprmv apr-util-1.4.1 httpd-2.4.2/srclib/apr-util
3、安装apache-2.4
cd /tmp/httpd-2.4.2./configure --prefix=/usr/local/apache --enable-so --enable-deflate=shared --enable-ssl=shared --enable-expires=shared& --enable-headers=shared --enable-rewrite=shared --enable-static-support& --with-included-apr --with-mpm=preforkmake && make installcp -f build/rpm/httpd.init /etc/init.d/httpdchmod +x /etc/init.d/httpdchkconfig --add httpdchkconfig httpd oncd /etcmv httpd httpd_oldln -s /usr/local/apache/ httpdcd /usr/sbin/ln -fs /usr/local/apache/bin/httpdln -fs /usr/local/apache/bin/apachectlcd /var/logrm -rf httpd/ln -s /usr/local/apache/logs httpd
相关资讯 & & &
& (04月16日)
& (01月25日)
& (07/12/:59)
& (04月11日)
& (12/13/:40)
& (07/12/:14)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
您的访问请求被拒绝 403 Forbidden - ITeye技术社区
您的访问请求被拒绝
亲爱的会员,您的IP地址所在网段被ITeye拒绝服务,这可能是以下两种情况导致:
一、您所在的网段内有网络爬虫大量抓取ITeye网页,为保证其他人流畅的访问ITeye,该网段被ITeye拒绝
二、您通过某个代理服务器访问ITeye网站,该代理服务器被网络爬虫利用,大量抓取ITeye网页
请您点击按钮解除封锁&当前位置:&>&&>&
Linux编译安装Apache2.4
时间: 14:08:59 &#160;&#160; 来源:服务器之家 &#160;&#160; 投稿:root
本文档试图以最简单方式阐明Apache2.4版本的安装。Apache采用的是automake编译方式,包括它所依赖的库,正因为这种依赖,使用得编译安装稍变复杂。
如果喜欢英文阅读,可直接查看官方的指南:http://httpd.apache.org/docs/2.4/install.html,这里有详细的说明。
Apache依赖apr、apr-util和pcre,下载网址为:
1) Apr和Apr-util:http://apr.apache.org/。截止,版本分别为:apr-1.4.6.tar.gz和apr-util-1.5.1.tar.gz;
2) Pcre:http://pcre.org/(实际下载网址是http://sourceforge.net/projects/pcre/files/pcre/和ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/,建议从sourceforge.net处下载,后一个经常抽风)。截止,版本为:pcre-8.32.tar.gz。
3. Apache2.4下载网址
http://httpd.apache.org/download.cgi#apache24
Apache2.4的源代码包为:httpd-2.4.3.tar.gz(注意最后一位版本号3可能不同)。
4. 安装步骤
Apr和Apr-util不用特别去编译和安装,随Apache一起完成,见下面的“安装Apache”一节。
4.1. 安装Pcre
在安装Apache之前,需要安装好Pcre,安装过程完全遵循automake方式,步骤依次如下:
1) ./configure
Cprefix=/usr/local/pcre(注:将Pcre安装到/usr/local/pcre目录下)
3) make install
4.2. 安装Apache
1) 将httpd-2.4.3.tar.gz上传到编译目录下(这里假设编译目录为/tmp/X,也可以为其它任意目录)
2) 进入/tmp/X目录,解压源码包:tar xzf
httpd-2.4.3.tar.gz,解压后会在/tmp/X产生一个httpd-2.4.3目录,在httpd-2.4.3目录下还会有个srclib子目录
3) 将Apr和Apr-util源码包上传到srclib子目录
4) 进入srclib子目录,将Apr和Apr-util源码包解压,如:tar xzf apr-1.4.6.tar.
tar xzf apr-util-1.5.1.tar.gz,注意解压后产生的Apr和Apr-util目录是带版本号的
5) 重命名Apr和Apr-util目录,去掉后面的版本号,如:mv apr-1.4.6 mv
apr-util-1.5.1 apr-util(这个在官方的指南里有说明的)
6) 进入/tmp/X/httpd-2.4.3目录,按照automake方式来编译Apache(注意需要指定Pcre):
./configure Cprefix=/usr/local/httpd Cwith-pcre=/usr/local/pcre
(注:/usr/local/httpd是Apache的安装目录,可根据需要修改)。
7) 接下来执行make编译源代码
8) 编译成功后,执行make install即可将Apache安装到/usr/local/httpd 目录下
9) 至此,大功告成!!!
5. 修改配置
如将Apache安装在/usr/local/httpd目录下,则进入/usr/local/httpd/conf目录,对http.conf按照需要进行修改,常修改的行有:
1) Listen 80
2) DocumentRoot “/usr/local/httpd/htdocs”
6. 附1:Apache官方中文文档主页
http://httpd.apache.org/docs/2.4/
7. 附2:一键脚本7.1. 一键脚本前提
1) 使用root用户操作;
2) Apr、Apr-util、Pcre和Apache安装包都放在同一个目录下,如:
~/app # ls
apr-1.4.6.tar.gz& apr-util-1.5.1.tar.gz&
httpd-2.4.3.tar.gz& pcre-8.32.tar.gz
3) 目录下不要放其它后缀为.tar.gz的文件
7.2. 一键脚本全文
# Writed by yijian on
# A key to install apache
# Download
#which wget
#if test $? - then
# echo “wget NOT FOUND”
# wget “http://mirror./apache/apr/apr-1.4.6.tar.gz”
# wget “http://mirror./apache/apr/apr-util-1.5.1.tar.gz”
# wget “/apache-mirror/httpd/httpd-2.4.3.tar.gz”
# wget “http://nchc.dl.sourceforge.net/project/pcre/pcre/8.32/pcre-8.32.tar.gz”
# Get names
apr_tar_gz=`ls |grep -e
“apr-[0-9]*.[0-9]*.[0-9]*.tar.gz”`
apr_util_tar_gz=`ls |grep -e
“apr-util-[0-9]*.[0-9]*.[0-9]*.tar.gz”`
apr=`basename $apr_tar_gz .tar.gz`
apr_util=`basename $apr_util_tar_gz .tar.gz`
httpd=`basename httpd-*.tar.gz .tar.gz`
pcre=`basename pcre-*.tar.gz .tar.gz`
echo $apr_util
echo $pcre
echo $httpd
# unzip files
tar xzf $apr.tar.gz
tar xzf $apr_util.tar.gz
tar xzf $pcre.tar.gz
tar xzf $httpd.tar.gz
mv $apr $httpd/srclib/apr
if test $? -ne 0; then
mv $apr_util $httpd/srclib/apr-util
if test $? -ne 0; then
# Compile pcre
./configure Cprefix=/usr/local/pcre
if test $? -ne 0; then
make install
if test $? -ne 0; then
# Compile apache
cd ../$httpd
./configure Cprefix=/usr/local/httpd
Cwith-pcre=/usr/local/pcre
if test $? -ne 0; then
if test $? -ne 0; then
make install
if test $? -ne 0; then
# Congratulation
echo “finished”
cd /usr/local/httpd/conf
转载请注明原文地址:

我要回帖

更多关于 apache2.4安装图解 的文章

 

随机推荐