<分区>
我将 Apache2 设置为使用虚拟主机为多个域提供服务。目标是在一台机器上的不同 Tomcat 实例下运行 QA 和生产环境。此设置有效,但 Prod 提供页面的速度比 QA 稍慢,尽管代码库几乎相同且没有流量。
我首先怀疑 httpd.conf 配置,只需要了解路由是否正确。我也会介绍这些网站,但我想将此作为第一步。尽管还设置了 MySQL 实例,但在这两种情况下我都没有访问数据库,所以这不太可能成为问题。
我检查了 stackoverflow 上的其他帖子,但没有发现这个特定的缓慢问题已经出现。想法?
httpd.conf:
<VirtualHost *:80>
ServerName www.theprodservername.com
ErrorLog logs/prod_error_log
CustomLog logs/prod_access_log common
ProxyPreserveHost On
ProxyPass / http://www.theprodservername.com:8083/
ProxyPassReverse / http://www.theprodservername.com:8083/
<Directory "/">
Options Indexes FollowSymLinks
#DirectoryIndex index.jsp
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.theqaservername.com
ServerAlias theqaserver.com
ErrorLog logs/qa_error_log
CustomLog logs/qa_access_log common
ProxyPreserveHost On
ProxyPass / http://www.theqaservername.com:8081/
ProxyPassReverse / http://www.theqaservername.com:8081/
<Directory "/">
Options Indexes FollowSymLinks
DirectoryIndex auth.jsp
</Directory>
</VirtualHost>
<!-- Prod server.xml -->
<Connector
port="8083"
proxyName="www.theprodservername.com"
proxyPort="80"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150"
maxHttpHeaderSize="8192">
</Connector>
<!-- QA server.xml -->
<Connector
port="8081"
proxyName="www.theqaservername.com"
proxyPort="80"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150"
maxHttpHeaderSize="8192">
</Connector>