apache编译手册_windows版本

Windows 下Apache httpd-2.2.11编译手记

平台:windows XP
编译工具:Microsoft VC6.0
源码下载:https://www.360docs.net/doc/483300833.html,/httpd
下载版本:httpd-2.2.11-win32-src-r2.zip 06-Jan-2009 02:55 9.6M HTTP Server project
1) 下载源码后解压,使用VC打开Apache.dsw文件,设置BuildBin classess 工程为Active。
2)开始编译,在编译中VC可能会提示错误。
3)如果编译提示没有找到strings.h和inet.h 错误:
D:\httpd-2.2.11\srclib\apr\include\apr_want.h(52): Could not find the file strings.h
D:\httpd-2.2.11\srclib\apr\include\apr_want.h(121): Could not find the file arpa/inet.h
打开httpd-2.2.11\srclib\apr\include\apr_want.h 文件,把以下行注释掉:
#if APR_HAVE_STRINGS_H
#include
#endif

#if APR_HAVE_ARPA_INET_H
#include
#endif

4) 如果编译时候提示不支持LDAP v2.0错误:
apr_ldap_stub.c
./include\apr_ldap.h(132) : fatal error C1189: #error : Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
apr_ldap_url.c
apr_ldap_url.c
./include\apr_ldap.h(132) : fatal error C1189: #error : Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
Generating Code...
打开httpd-2.2.11\srclib\apr-util\include\apr_ldap.h 文件,注释该行代码:
#error : Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit
5) 如果出现identifier 'SQLLEN' 错误:
D:httpd-2.2.11\srclib\apr-util\dbd\apr_dbd_odbc.c(134) : error C2061: syntax error : identifier 'SQLLEN'
打开文件:httpd-2.2.11\srclib\apr-util\dbd\apr_dbd_odbc.c,在文件头部添加以下行:
typedef INT32 SQLLEN
typedef UINT32 SQLULEN
6) 如果出现LDAP_VENDOR_NAME 错误:
D:\httpd-2.2.11\srclib\apr-util\ldap\apr_ldap_init.c(194) : error C2146: syntax error : missing ';' before identifier 'LDAP_VENDOR_NAME'
D:\httpd-2.2.11\srclib\apr-util\ldap\apr_ldap_init.c(195) : error C2065: 'LDAP_VENDOR_NAME' : undeclared identifier
D:\httpd-2.2.11\srclib\apr-util\ldap\apr_ldap_init.c(195) : error C2143: syntax error : missing ';' before 'string'
打开httpd-2.2.11\srclib\apr-util\ldap\apr_ldap_init.c 文件,注释以下行:
LDAP_VENDOR_NAME
7) 如果出现WtsApi32.h没有包含错误:
D:\httpd-2.2.11\support\win32\ApacheMonitor.c(45) : fatal error C1083: Cannot open include file: WtsApi32.h': No such file or directory
该提示表示没有安装或配置Microsoft 的PlatformSDK,需要去微软网站上下载PlatformSDK,并安装。
8) 如果提示awk 错误:
'awk' 不是内部或外部命令,也不是可运行的程序或批处理文件。
Error executing c:\windows\system32\cmd.exe.
这个错误是由于没有安装awk工具导致,可以先到https://www.360docs.net/doc/483300833.html,/software/gawk/ 下载一个gawk进行安装。如果安装的目录为:C:\Program Files\GnuWin32,在该目录下

可以看到一个bin目录,需要把该目录添加到VC Executable files。我的bin目录完整路径为:C:\Program Files\GnuWin32\bin
可以直接在网上搜索gawk for Windows的编译好的版本

相关文档
最新文档