yuu_nkjm blog


2012-10-31(Wed) 編集

[openSUSE][Apache][Tomcat] ApacheとTomcatの連携 (ajp版.自分の環境ではjk版より実績あり)

以下は,openSUSE 12.2 (64bit)環境で実行した.

apacheモジュールの追加

yast→ /etc/sysconfigエディタ→ Network/WWW/Apache2 → APACHE_MODULESより "proxy proxy_ajp"を追加する.

ロードされたモジュールを確認する.

# apache2ctl -t -D DUMP_MODULES
 
httpd2: apr_sockaddr_info_get() failed for suse-vbox
httpd2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_default_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 dir_module (shared)
 env_module (shared)
 expires_module (shared)
 include_module (shared)
 log_config_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 setenvif_module (shared)
 ssl_module (shared)
 userdir_module (shared)
 reqtimeout_module (shared)
 proxy_module (shared)
 proxy_ajp_module (shared)
Syntax OK

プロキシの設定

"/etc/apache2/conf.d/mod_proxy_ajp.conf"という設定ファイルを作り,プロキシの設定を書き込む.例えば,以下のようにすると."http://hoge.nkjm.info:8080/manager/"でアクセスできるページに"http://hoge.nkjm.info/manager/"でアクセス出来るようになる.

ProxyPass /manager ajp://localhost:8009/manager
ProxyPass /app1 ajp://localhost:8009/app1
ProxyPass /app2 ajp://localhost:8009/app2

トップ «前の日(10-30) 最新 次の日(11-01)» 追記 設定
2006|01|06|12|
2007|06|09|
2008|01|03|04|06|07|08|09|10|12|
2009|01|02|05|06|07|08|10|11|12|
2010|03|04|05|06|07|08|09|10|11|
2011|01|02|03|04|05|06|07|08|09|11|12|
2012|01|02|04|06|07|08|10|11|12|
2013|01|02|03|07|08|10|11|12|
2014|01|02|04|05|06|07|08|09|10|11|
2015|01|02|07|11|12|
2016|01|03|05|07|08|09|