将Apache http 服务器改写为Socket 的Server文档格式.docx
- 文档编号:20916194
- 上传时间:2023-01-26
- 格式:DOCX
- 页数:9
- 大小:16.30KB
将Apache http 服务器改写为Socket 的Server文档格式.docx
《将Apache http 服务器改写为Socket 的Server文档格式.docx》由会员分享,可在线阅读,更多相关《将Apache http 服务器改写为Socket 的Server文档格式.docx(9页珍藏版)》请在冰豆网上搜索。
EXTRA_CPPFLAGS=-U__STR__-D_THREAD_SAFE-D_USE_IRS-qthreaded-q64-D__XCOFF32__-D__XCOFF64__
EXTRA_CFLAGS=-g-qHALT=E-qthreaded-q64-D__XCOFF32__-D__XCOFF64__
EXTRA_LDFLAGS=-L/product1/boss/interface/callcenter_all/srclib/apr-util/xml/expat/lib
EXTRA_LIBS=$(TUXDIR)/lib/wstpinit.o-L$(TUXDIR)/lib-lwsc-lbuft-lgpnet-lfml-lfml32-lengine-lpthread-lnsl-lz-lm-lcrypt-ldl
EXTRA_INCLUDES=-I/product1/boss/UNIX_DEV/-I$(TUXDIR)/include-I/product1/boss/interface/callcenter_all/include-I$(top_builddir)/srclib/pcre-I.-I$(top_srcdir)/os/$(OS_DIR)-I$(top_srcdir)/server/mpm/$(MPM_SUBDIR_NAME)-I$(top_srcdir)/modules/http-I/product1/boss/interface/callcenter_all/srclib/apr/include-I/product1/boss/interface/callcenter_all/srclib/apr-util/include-I/product1/boss/interface/callcenter_all/srclib/apr-util/xml/expat/lib
//hp可以不改
build/apr_rules.mksrclib/apr/build/apr_rules.mk
EXTRA_CFLAGS=-g-qHALT=E-q64
EXTRA_CPPFLAGS=-U__STR__-D_THREAD_SAFE-D_USE_IRS-D_LARGEFILE64_SOURCE-D__XCOFF32__-D__XCOFF64__
EXTRA_LDFLAGS=-Wl,-brtl-b64
EXTRA_LIBS=-lpthread
EXTRA_INCLUDES=
srclib/apr-util/build/rules.mk
./build/libtool
./srclib/apr/libtool
./srclib/apr-util/xml/expat/libtool
增加AR_FLAGS="
-X64cru"
server/Makefile:
EXPORT_DIRS=$(top_srcdir)/include$(top_srcdir)/os/$(OS_DIR)$(top_srcdir)/modules/http
把include下struct.h,define.hcopy到include路径下
修改include下httpd.h的conn_rec结构,增加:
longin_len;
char*in_buffer;
/*发送缓存长度*/
longout_len;
char*out_buffer;
char*send_buff;
char*recv_buff;
intconnfd;
charhead_buff[80];
char*head;
char*send_pos;
longsend_left;
char*recv_pos;
longrecv_left;
apr_socket_t*client_socket;
修改server/core.c的core_pre_connection函数
增加:
c->
in_len=0;
in_buffer=(char*)apr_pcalloc(c->
pool,1024*2+1);
out_len=0;
out_buffer=(char*)apr_pcalloc(c->
pool,1024*300+1);
send_buff=(char*)apr_pcalloc(c->
recv_buff=(char*)apr_pcalloc(c->
client_socket=csd;
注释:
ap_add_input_filter_handle(ap_core_input_filter_handle,net,NULL,net->
c);
ap_add_output_filter_handle(ap_core_output_filter_handle,net,NULL,net->
worker.c中增加:
pthread_mutex_tenv_mutex=PTHREAD_MUTEX_INITIALIZER;
pthread_cond_tenv_cond=PTHREAD_COND_INITIALIZER;
注意modules/http下的modules.mk一定要齐.
2.2.0日志汉字问题解决?
修改server/log.c文件的log_error_core函数:
把
#ifndefAP_UNSAFE_ERROR_LOG_UNESCAPED
if(apr_vsnprintf(scratch,MAX_STRING_LEN-len,fmt,args)){
len+=ap_escape_errorlog_item(errstr+len,scratch,
MAX_STRING_LEN-len);
}
#else
len+=apr_vsnprintf(errstr+len,MAX_STRING_LEN-len,fmt,args);
#endif
注释掉:
用:
len+=apr_vsnprintf(errstr+len,MAX_STRING_LEN-len,fmt,args);
取代
注释掉最后的:
ap_run_error_log(file,line,level,status,s,r,pool,errstr+errstrlen);
server/Makefile修改:
export_files:
tmp=export_files_unsorted.txt;
\
rm-f$$tmp&
&
touch$$tmp;
fordirin$(EXPORT_DIRS);
do\
ls$$dir/*.h>
>
$$tmp;
done;
sort-u$$tmp>
$@;
rm-f$$tmp
把EXPORT_DIRS_APR去掉了,因为在include下都有需要的.h文件,并且去掉include下os.hmod_core.hunixd.h
#这三个文件在modules/http/mod_core.h和os/unix/os.hos/unix/unixd.h因此去掉下面部分
#fordirin$(EXPORT_DIRS_APR);
#ls$$dir/ap[ru].h>
#ls$$dir/ap[ru]_*.h>
#done;
把httpd-mpm.conf的内容加在httpd.conf后面
---
#将apache编译成静态库连接
改
build_libtool_libs=no
build_old_libs=yes
谢灵杰15:
14:
58
安装./configure--prefix=/product2/boss/interface/callcenter--with-mpm=worker--with-program-name=callcenter--disable-mime--enable-static-support--disable-cache--disable-generators--disable-mappers--disable-ssl--disable-aaa--disable-experimental--disable-metadata--disable-dav--disable-filters--disable-proxy--disable-generators
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 将Apache http 服务器改写为Socket 的Server Apache 服务器 改写 Socket Server