私は2つのTomcatインスタンス「geonetwork」と「geoserver」にすべてのリクエストをリダイレクトすると思われるApacheサーバーを持っています。Apacheプロキシmod_JKを使用した複数のTomcatインスタンス
これらはどちらもApacheサーバーからアクセスできますが、何らかの形でリダイレクトを行うことはできません。
<VirtualHost *:80>
ServerName localhost
ServerAdmin [email protected]
DocumentRoot /var/www/html
</VirtualHost>
<VirtualHost *:80>
ServerName geonetwork
ServerAdmin [email protected]
DocumentRoot /usr/local/tomcat_gn/webapps
<Directory "/usr/local/tomcat_gn/webapps">
#Options MultiViews FollowSymLinks
Options All
AllowOverride all
Require all granted
</Directory>
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
JkMount /geonetwork|/* gn_worker
</VirtualHost>
<VirtualHost *:80>
ServerName geoserver
ServerAdmin [email protected]
DocumentRoot /usr/local/tomcat_gs/webapps
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
JkMount /geoserver|/* gs_worker
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
のDocumentRootディレクティブ、ディレクトリをマウントのTomcatインスタンスへのポイント:
私のhostsファイルは、次のようになります。
最も私を打つ何#
worker.list=gn_worker,gs_worker
#
#------ ajp13_worker WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#
#
# Defining a worker named ajp13_worker and of type ajp13
# Note that the name and the type do not have to match.
#
worker.gs_worker.port=8009
worker.gs_worker.host=geoserver
worker.gs_worker.type=ajp13
worker.gn_worker.port=8009
worker.gn_worker.host=geonetwork
worker.gn_worker.type=ajp13
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.gs.lbfactor=1
worker.gn.lbfactor=1
#
# Specify the size of the open connection cache.
#worker.ajp13_worker.cachesize
#
#------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
#---------------------------------------------------------------------
#
#
# The loadbalancer (type lb) workers perform wighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# workers.
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=gn_worker,gs_worker
、最初のバーチャルホストが常に動作していることである:
この
はworker.propertiesファイルです。したがって、この例では、Apacheのルートに解決されますが、私はgeonetworkまたはgeoserver置けば、それはに正しく解決されます。私はこれをデバッグするためにアイデアを走ってるhttp://localhost/geonetworkまたはhttp://localhost/geoserver
!誰かが私を助けることができますか?
非常に簡単なApache mod_proxyを使用してプロキシを設定しました。 – doublebyte