apache tomcat整合Word文件下载.docx
- 文档编号:15391988
- 上传时间:2022-10-29
- 格式:DOCX
- 页数:13
- 大小:543.65KB
apache tomcat整合Word文件下载.docx
《apache tomcat整合Word文件下载.docx》由会员分享,可在线阅读,更多相关《apache tomcat整合Word文件下载.docx(13页珍藏版)》请在冰豆网上搜索。
tomcat实例二IP:
192.168.123.20/24(端口默认)
一:
mod_proxy方式的整合
1:
编译安装apache,需要编译proxy相关的模块,这里采用目前最新版的apache2.4.2
1[root@db1~]#tar-zxvpfhttpd-2.4.2.tar.gz
2[root@db1~]#cdhttpd-2.4.2
3[root@db1httpd-2.4.2]#./configure--prefix=/usr/local/apache--enable-proxy--enable-proxy-ajp--enable-rewrite--enable-so--enable-headers--enable-expires--enable-modules-shared=most--with-apr=/usr/local/apr/--with-apr-util=/usr/local/apr-util/
4[root@db1httpd-2.4.2]#make
5[root@db1httpd-2.4.2]#makeinstall
若启动apache出现下面的错误,基本上属于apr的问题,要么apr没安装,要么版本不对!
[root@db1~]#/usr/local/apache/bin/apachectl-t
httpd:
Syntaxerroronline113of/usr/local/apache/conf/httpd.conf:
Cannotload/usr/local/apache/modules/mod_proxy.sointoserver:
/usr/local/apache/modules/mod_proxy.so:
undefinedsymbol:
apr_global_mutex_lockfile
[root@db1~]#yumremoveapr
[root@db1~]#/usr/local/apache/bin/apachectl-t
SyntaxOK
[root@db1~]#/usr/local/apache/bin/apachectl-t-DDUMP_MODULES|grepproxy
proxy_module(shared)
proxy_connect_module(shared)
proxy_ftp_module(shared)
proxy_http_module(shared)
proxy_fcgi_module(shared)
proxy_scgi_module(shared)
proxy_ajp_module(shared)
proxy_balancer_module(shared)
proxy_express_module(shared)
2:
配置apache的虚拟主机
1[root@db1~]#/usr/local/apache/bin/apachectl-t-DDUMP_VHOSTS
2VirtualHostconfiguration:
3*:
80isaNameVirtualHost
4defaultserver192.168.123.110(/usr/local/apache/conf/extra/httpd-vhosts.conf:
23)
5port80namevhost192.168.123.110(/usr/local/apache/conf/extra/httpd-vhosts.conf:
6port80namevhost192.168.123.110(/usr/local/apache/conf/extra/httpd-vhosts.conf:
7port80namevhost(/usr/local/apache/conf/extra/httpd-vhosts.conf:
31)
8port80namevhost(/usr/local/apache/conf/extra/httpd-vhosts.conf:
若启动apache报错如下,则需要加载mod_slotmem_shm.so模块,之前在使用apache中很少用到mod_proxy模块,所以遇到的问题多多!
[root@db1~]#/usr/local/apache/bin/apachectl-kstart
[root@db1~]#echo$?
0
[root@db1~]#netstat-ntpl|grep:
80
[root@db1~]#cat/usr/local/apache/logs/error_log
[FriAug1018:
32:
25.2984362012][proxy_balancer:
emerg][pid7859:
tid47937562389216]AH01177:
Failedtolookupprovider'
shm'
for'
slotmem'
:
ismod_slotmem_shmloaded?
?
25.2986502012][:
tid47937562389216]AH00020:
ConfigurationFailed,exiting
34:
04.7178012012][proxy_balancer:
emerg][pid7876:
tid47508265659104]AH01177:
04.7179512012][:
tid47508265659104]AH00020:
[root@db1~]#grep'
/usr/local/apache/conf/httpd.conf
LoadModuleslotmem_shm_modulemodules/mod_slotmem_shm.so
tcp00:
80:
*LISTEN7898/httpd
注意:
2.4.2版本的apache中需要在目录下面添加Requireallgranted,否则无论怎么访问都是403,悲了个催的!
具体报错如下:
[FriAug1019:
07:
13.2638932012][authz_core:
error][pid8918:
tid1126259008][client192.168.123.102:
53420]AH01630:
clientdeniedbyserverconfiguration:
/tmp
9[root@db1~]#grep-v'
^#'
/usr/local/apache/conf/extra/httpd-vhosts.conf|grep-v'
^$'
10<
VirtualHost*:
80>
11ServerName192.168.123.110
12<
Location/>
13Orderdeny,allow
14Denyfromall
15<
/Location>
16<
/VirtualHost>
17<
18ServerName
19DocumentRoot/tmp
20<
Directory/tmp>
21Options+indexes
22Orderallow,deny
23Allowfromall
24Requireallgranted
25<
/Directory>
26<
3:
安装jdk和tomcat,并启动tomcat
1[root@db2~]#java-version
2javaversion"
1.6.0"
3OpenJDKRuntimeEnvironment(build1.6.0-b09)
4OpenJDK64-BitServerVM(build1.6.0-b09,mixedmode)
5
6[root@db2~]#/usr/local/tomcat7/bin/startup.sh
7UsingCATALINA_BASE:
/usr/local/tomcat7
8UsingCATALINA_HOME:
9UsingCATALINA_TMPDIR:
/usr/local/tomcat7/temp
10UsingJRE_HOME:
/usr/local/java
11UsingCLASSPATH:
/usr/local/tomcat7/bin/bootstrap.jar:
/usr/local/tomcat7/bin/tomcat-juli.jar
12
13[root@db2~]#netstat-ntpl|grepjava
14tcp00:
ffff:
127.0.0.1:
8005:
*LISTEN7601/java
15tcp00:
8009:
16tcp00:
8080:
4:
使用mod_proxy转发jsp的请求,test目录,tomcat.css,tomcat.png请求使用apache处理
19DocumentRoot/tmp
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- apache tomcat整合 tomcat 整合