[url=http://javadonkey.iteye.com/blog/210868]接上篇[/url]
[size=medium][b]安装mod.jk[/b][/size]
先要下载mod.jk
[url]http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/[/url]
找到你需要的版本下载即可
本例文件:[b]mod_jk-1.2.26-httpd-2.2.6.so[/b]
下载后进入到文件目录执行
[color=red]linux 自带的apache在/etc/httpd/[/color]
[b]配置[/b]
在[b]/usr/local/apache/conf/extra[/b]创建一个配置文件[b]workers.properties[/b]
添加内容:
# Defining a worker named worker1 and of type ajp13
worker.list=worker1
# Set properties for worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
再配置[b]/usr/local/apache/conf/httpd.conf[/b],作以下修改:
[list=1]
[*]修改DocumentRoot(默认的根目录) "/var/www/html"
[*]增加关于加载mod_jk的语句:
LoadModule jk_module modules/mod_jk-1.2.26-httpd-2.2.6.so
JkWorkersFile conf/extra/workers.properties
[*]增加mod_jk的配置:
<VirtualHost *:80>
JkMount /hr/servlet/* worker1
JkMount /hr/*.jsp worker1
JkMount /hr/*.do worker1
ServerAdmin njgnini@163.com
ServerName www.iteye.com
ServerAlias www.iteye.com.cn
RewriteEngine On
RewriteRule ^/$ /hr/ [R,P]
[color=red]#rewrite 访问www.iteye.com转到 www.iteye.com/hr/ 地址栏显示 www.iteye.com[/color]
SetEnv force-proxy-request-1.0.1
SetEnv proxy-nokeepalive 1
[color=red]# 以上两行设置是防止IE5.5以下版本的浏览器访问出现问题[/color]
</VirtualHost>
[*]
增加图片访问目录
<Directory "/var/photo">
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
DirectoryIndex /default.png
ErrorDocument 404 /default.png
# 如果没有指定图片显示的默认图
</Directory>
<VirtualHost *:80>
DocumentRoot "/var/photo"
ServerAdmin admin@haha.cn
ServerName photo.cn
ServerAlias photo.cn
</VirtualHost>
[/list]然后保存退出 启动apache和jboss 访问[b]http://你的ip地址/[/b] 打开jboss页面就O了!!
[size=medium][b]安装mod.jk[/b][/size]
先要下载mod.jk
[url]http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/[/url]
找到你需要的版本下载即可
本例文件:[b]mod_jk-1.2.26-httpd-2.2.6.so[/b]
下载后进入到文件目录执行
[color=red]linux 自带的apache在/etc/httpd/[/color]
# cp mod_jk-1.2.26-httpd-2.2.6.so /usr/local/apache2/modules/
[b]配置[/b]
在[b]/usr/local/apache/conf/extra[/b]创建一个配置文件[b]workers.properties[/b]
添加内容:
# Defining a worker named worker1 and of type ajp13
worker.list=worker1
# Set properties for worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
再配置[b]/usr/local/apache/conf/httpd.conf[/b],作以下修改:
[list=1]
[*]修改DocumentRoot(默认的根目录) "/var/www/html"
[*]增加关于加载mod_jk的语句:
LoadModule jk_module modules/mod_jk-1.2.26-httpd-2.2.6.so
JkWorkersFile conf/extra/workers.properties
[*]增加mod_jk的配置:
<VirtualHost *:80>
JkMount /hr/servlet/* worker1
JkMount /hr/*.jsp worker1
JkMount /hr/*.do worker1
ServerAdmin njgnini@163.com
ServerName www.iteye.com
ServerAlias www.iteye.com.cn
RewriteEngine On
RewriteRule ^/$ /hr/ [R,P]
[color=red]#rewrite 访问www.iteye.com转到 www.iteye.com/hr/ 地址栏显示 www.iteye.com[/color]
SetEnv force-proxy-request-1.0.1
SetEnv proxy-nokeepalive 1
[color=red]# 以上两行设置是防止IE5.5以下版本的浏览器访问出现问题[/color]
</VirtualHost>
[*]
增加图片访问目录
<Directory "/var/photo">
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
DirectoryIndex /default.png
ErrorDocument 404 /default.png
# 如果没有指定图片显示的默认图
</Directory>
<VirtualHost *:80>
DocumentRoot "/var/photo"
ServerAdmin admin@haha.cn
ServerName photo.cn
ServerAlias photo.cn
</VirtualHost>
[/list]然后保存退出 启动apache和jboss 访问[b]http://你的ip地址/[/b] 打开jboss页面就O了!!