0

I set up Apache2 to serve up multiple domains using virtual hosting. The goal is to run QA and Production environments under separate Tomcat instances on one machine. This setup is working, but Prod is serving pages a little slower than QA, despite a nearly identical codebase and no traffic.

I'm holding the httpd.conf config suspect first and just need to understand whether the routing is correct. I will profile the sites too, but wanted to take this as a first step. Although MySQL instances are also set up, I'm not hitting a database yet in either case, so that is unlikely to be the issue.

I checked other postings on stackoverflow, but don't see that this particular issue of slowness has arisen. Thoughts?

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>
riddle_me_this
  • 8,575
  • 10
  • 55
  • 80

1 Answers1

1

Did you check the speed of the the tomcat instances without apache? Are there any differences?

Your apache config looks good. You could also try with modjk.

user582846
  • 23
  • 5