有你才完美WoW 发表于 2015-8-21 15:19:46

为wamp配置 Axis2/c

  为wamp配置 Axis2/c
WAMP = windows + apache + mysql + php
  环境: Windows XP + VS2008
一.wamp
   1.下载安装
             地址: http://www.wampserver.com/en/
    这里选择的是:WAMPSERVER (32 BITS & PHP 5.3) 2.2E
    这里安装在C盘
    安装后目录如: C:\wamp\wampmanager.exe
  2.配置apache
    配置apache可以被局域网内电脑访问
    (自己玩可以直接跳过...)
     配置文件:C:\wamp\bin\apache\apache2.2.22\conf\httpd.conf
    找到如下小节:
    <Directory "c:/wamp/www/">
       ……
       Deny from all
       ……
    </Directory>
    将"Deny from all" 修改为 "Allow from all"

  二.axis2/c
  1.下载axis2.c源码
    地址:http://axis.apache.org/axis2/c/core/download.cgi
    这里选择如下:
    1.5.0 Release MS Windows Distribution
    Source Distribution zip
     解压后目录如:E:\ljz_code_other\axis2c-src-1.5.0\axis2c_build.sh
    (可以直接下载 Binary Distribution zip,使用编译好的版本)
  2.下载依赖项
    apache官网手册提供的依赖下载地址 :ftp://ftp.zlatkovic.com/libxml/
    分别下载:libxml2、iconv、zlib
    解压后目录分别如下:
    E:\ljz_code_other\libxml2-2.7.8.win32\bin\libxml2.dll
    E:\ljz_code_other\iconv-1.9.2.win32\bin\iconv.dll
    E:\ljz_code_other\zlib-1.2.5\bin\zlib1.dll
  3.编译
    先配置axis2依赖配置文件
    配置文件:E:\ljz_code_other\axis2c-src-1.5.0\build\win32\configure.in
    主要配置项:LIBXML2_BIN_DIR、ICONV_BIN_DIR、ZLIB_BIN_DIR、APACHE_BIN_DIR
    如下:
         LIBXML2_BIN_DIR = E:\ljz_code_other\libxml2-2.7.8.win32
         ICONV_BIN_DIR = E:\ljz_code_other\iconv-1.9.2.win32
         ZLIB_BIN_DIR= E:\ljz_code_other\zlib-1.2.5
         APACHE_BIN_DIR = "C:\wamp\bin\apache\apache2.2.22"
    找到VS2008下 vcvars32.bat文件的路径,将其添加到系统环境变量PATH
    默认路径是:C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
    运行 cmd 命令行工具
    切换到目录 E:\ljz_code_other\axis2c-src-1.5.0\build\win32
    执行vcvars32.bat,如下:
  



    E:\ljz_code_other\axis2c-src-1.5.0\build\win32>vcvars32.bat
    E:\ljz_code_other\axis2c-src-1.5.0\build\win32>"C:\Program Files\Microsoft Visua
    l Studio 9.0\Common7\Tools\vsvars32.bat"
    Setting environment for using Microsoft Visual Studio 2008 x86 tools.
    E:\ljz_code_other\axis2c-src-1.5.0\build\win32>

  
  
    如果提示vcvars32不是内部命令,则vcvars32.bat环境变量设置有问题
    环境变量设置后要重新打开cmd窗口
    不运行vsvars32.bat会报nmake的错误...
    成功后执行:



    E:\ljz_code_other\axis2c-src-1.5.0\build\win32>nmake install
  成功后执行:



    E:\ljz_code_other\axis2c-src-1.5.0\build\win32>nmake axis2_apache_module

  
    编译结束...
    如果要直接运行E:\ljz_code_other\axis2c-src-1.5.0\build\deploy\bin\axis2_http_server.exe 测试的话
    要将E:\ljz_code_other\axis2c-src-1.5.0\build\deploy\lib\; 加入系统环境变量PATH中,
    因为axis2_http_server.exe依赖lib文件夹中的dll
    E:\ljz_code_other\axis2c-src-1.5.0\ides\vc\axis2c 目录中有提供VS项目工程文件
    但依赖项什么的要在VS中重新设置,否则找不到ibxml2、iconv、zlib
三.将axis2配置到wamp
    编辑配置文件:C:\wamp\bin\apache\apache2.2.22\conf\httpd.conf
    增加如下字段:
    LoadModule axis2_module "E:/ljz_code_other/axis2c-src-1.5.0/build/deploy/lib/mod_axis2.dll"
    Axis2RepoPath "E:/ljz_code_other/axis2c-src-1.5.0/build/deploy"
    Axis2LogFile "E:/ljz_code_other/axis2c-src-1.5.0/build/deploy/logs"
    Axis2MaxLogFileSize 50
    Axis2LogLevel debug
    <Location /axis2>
    SetHandler axis2_module
    </Location>
    重新启动wamp.
    浏览器输入地址:http://localhost/axis2/services
    正确的话要看到 E:\ljz_code_other\axis2c-src-1.5.0\build\deploy\services 目录下提供的服务
    默认apache配置检测80端口,这里加入axis2后仍是80端口
    E:\ljz_code_other\axis2c-src-1.5.0\build\deploy\bin\samples里的几个sample用的是9090端口,
    所以如果要测这些客户端sample的话,运行E:\ljz_code_other\axis2c-src-1.5.0\build\deploy\bin\axis2_http_server.exe
四.........
开始的时候,是下载编译好的 axis2/c Binary.
修改完httpd.conf后,wamp就无法正常启动.
直接双击运行:C:\wamp\bin\apache\apache2.2.22\bin\httpd.exe后
C:\wamp\logs\apache_error.log 显示:
..\..\src\core\deployment\dep_engine.c(324) Axis2 Configuration file name not found
..\..\src\core\deployment\conf_init.c(56) Creating deployment engine failed for repository E:/ljz_code_other/axis2c-src-1.5.0/build/deploy/services
便下载源代码,修改了dep_engine.c(324),输出dep_engine->conf_name的值
编译后启动wamp显示:
..\..\src\core\deployment\dep_engine.c(324) Axis2 Configuration file name not found E:/ljz_code_other/axis2c-src-1.5.0/build/deploy/services/axis2.xml.
..\..\src\core\deployment\conf_init.c(56) Creating deployment engine failed for repository E:/ljz_code_other/axis2c-src-1.5.0/build/deploy/services
  而axis2的配置文件 axis2.xml的实际所在目录是:E:\ljz_code_other\axis2c-src-1.5.0\build\deploy\axis2.xml
   才发现httpd.conf文件的 Axis2RepoPath 项目配错,之前一直以为Axis2RepoPath 是配 services的目录

  最后
  忘记AXIS2C_HOME这个环境变量是做什么的了....
 貌似可以不加,这里加的话是:E:\ljz_code_other\axis2c-src-1.5.0\build\deploy
 即axis配置文件axis2.xml所在的目录.

  .......好吧,想起来了,samples跑的时候要检测这个环境变量..
  ------------------
  axis3c-src-1.5.0\build\win32\configure.in文件如下:



#############################################################################
### Build Details ###
#############################################################################
#
# enables https support
ENABLE_SSL = 0         
#
# build libcurl transport
ENABLE_LIBCURL = 0
#
# build axis2 with Libxml2 Parser. Axis2/C will be built with embeded guththila # parser by Default.
ENABLE_LIBXML2=0
#
# build tcp server in addition to http server
WITH_TCP = 0
#
# build with archive based deployment
WITH_ARCHIVE = 0
#
#
#############################################################################
### Dependant Binary Locations (Required) ###
#############################################################################
#
# libxml2 binary location ( axis2c is built with libxml2 )
#LIBXML2_BIN_DIR = F:\applications\libxml2-2.6.30.win32
LIBXML2_BIN_DIR = E:\ljz_code_other\libxml2-2.7.8.win32
#
# iconv binary location
#ICONV_BIN_DIR = F:\applications\iconv-1.9.2.win32
ICONV_BIN_DIR = E:\ljz_code_other\iconv-1.9.2.win32
#
# zlib binary location
#ZLIB_BIN_DIR= F:\applications\zlib-1.2.3.win32
ZLIB_BIN_DIR= E:\ljz_code_other\zlib-1.2.5
#
#
#############################################################################
### Dependant Binary Locations (Optional) ###
#############################################################################
#
# opensslbinary location
# required if ENABLE_SSL = 1
#OPENSSL_BIN_DIR = c:\OpenSSL
#
# libcurl binary location, only required if libcurl transport is enabled
#LIBCURL_BIN_DIR = E:\libcurl-7.15.1-msvc-win32-ssl-0.9.8a-zlib-1.2.3
#
#
#############################################################################
### Apache Server module (required when building Axis2/C Apache Module) ###
#############################################################################
#
# apache binary location
#APACHE_BIN_DIR = "C:\Program Files\Apache Software Foundation\Apache2.2"
APACHE_BIN_DIR = "C:\wamp\bin\apache\apache2.2.22"
#
# apache 2 server family
# To use apache 2.2 family, useAPACHE_VERSION_IS_2_0_X = 0
APACHE_VERSION_2_0_X = 0
#
#
#############################################################################
### Compiler Options ###
#############################################################################
#
# C runtime LIBRARY OPTION ( Use /MD or /MT )
CRUNTIME = /MD
#
# Embed Manifest Files
EMBED_MANIFEST = 1
#
# debug symbols
# To build with debug symbols use DEBUG = 1
DEBUG = 1
#

  
  
页: [1]
查看完整版本: 为wamp配置 Axis2/c