Apache Tomcat 연동
- 꼬반
- 2015. 6. 10. 14:19
====== mod_proxy를 이용한 연동 방법 ======
====== apache - tomcat 연동 (ajp) ======
<code>
NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerAdmin email@email.com
DocumentRoot /location/tomcat7
ServerName server.dns.com
ErrorLog logs/servername-error_log
CustomLog logs/servername-access_log common
ProxyPass / ajp://localhost:8009/url/
ProxyPassReverse / ajp://localhost:8009/url/
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} .(htm|html|jpg|gif|png|swf$)
RewriteRule (.*) - [L]
RewriteRule (.*)ajp://localhost:8009$1 [P]
</VirtualHost>
</code>