1

I have my Windows 7 localhost server configured with my main localhost address and a couple of virtual hosts configured to serve cookie-less images and JavaScript (I also have a few other virtual hosts configured).

I am having 5000ms load times on a couple of the files using the virtual host address and could use some help figuring out why.

enter image description here

UPDATE

Based upon the advice on this post, I've commented out ::1 localhost. I'll see if this solves the problem and report back.

My hosts file contains the following:

127.0.0.1 localhost static mseifert design static-mseifert static-design
::1 localhost

My virtual hosts are set us as so:

<VirtualHost *:80>
    ServerAdmin michael@localhost
    DocumentRoot "D:/Website/mseifert/xyz"
    ServerName static

    <Directory "D:/Website/mseifert/xyz">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order deny,allow
        deny from all
        Allow from localhost
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin michael@localhost
    DocumentRoot "D:/Website/mseifert"
    ServerName static-mseifert

    <Directory "D:/Website/mseifert">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order deny,allow
        deny from all
        Allow from localhost
        Require all granted
    </Directory>
</VirtualHost>

There are no errors in my apache access.log:

127.0.0.1 - - [07/Feb/2017:20:38:49 -0800] "GET / HTTP/1.1" 200 101841
127.0.0.1 - - [07/Feb/2017:20:39:11 -0800] "GET /css/colwidth.min.css?v=1476516603 HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:11 -0800] "GET /js-common/dragdrop.min.js?v=1483776115 HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:11 -0800] "GET /css/slideshow.css.php?static-img-common=http://static-mseifert/img-common&v=1484865716 HTTP/1.1" 200 6394
127.0.0.1 - - [07/Feb/2017:20:39:11 -0800] "GET /css/slideshow.min.js?v=1486279758 HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:11 -0800] "GET /js-common/common.min.js?v=1485074534 HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:11 -0800] "GET /js/media.match.min.js?v=1370658510 HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:11 -0800] "GET /css/ms.min.js?v=1485063063 HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:11 -0800] "GET /css/wtr.css.min.php?static-img-common=http://static-mseifert/img-common&static-site-root=http://static&static-top-root=http://static-mseifert&v=1486360034 HTTP/1.1" 200 37255
127.0.0.1 - - [07/Feb/2017:20:39:11 -0800] "GET /js/hmac-sha1.js?v=1455443904 HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:12 -0800] "GET /img-common/lock.png HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:12 -0800] "GET /img/lady.jpg HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:12 -0800] "GET /img/lady-header.jpg HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:12 -0800] "GET /img-common/menublank.png HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:12 -0800] "GET /img-common/menublanka.png HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:12 -0800] "GET /img-common/arrow.gif HTTP/1.1" 304 -
127.0.0.1 - - [07/Feb/2017:20:39:12 -0800] "GET /img-common/vmenuback.gif HTTP/1.1" 304 -
Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
mseifert
  • 175
  • 3
  • 13

1 Answers1

0

Only use IP addresses in Apache config directives.

Instead of using localhost in your Apache config file, just use 127.0.0.1. So this:

Allow from localhost

Changes to this:

Allow from 127.0.0.1

I go into more detail in my other answer to another question over here, but basically HostnameLookups is a slow process for Apache and when it is part of an Apache config directive, HostnameLookups switches on even if it is disabled elsewhere. So it trues to resolve localhost and just hangs and hangs.

This cleared up many “mystery” hangs on Apache servers that used Allow/Deny directives.

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
  • Thanks. I will give it a try. Commenting out ::1 localhost seemed to take care of it on first blush, but the sample size was small. – mseifert Feb 09 '17 at 04:46
  • Having commented out ::1 localhost seemed to solve the problem and the 5000ms times went away. Interestingly, when changing all `Allow from localhost` to `Allow from 127.0.0.1` in the httpd-vhosts.conf (there are none in httpd.conf), the performance monitor again shows many files with 5000ms load times. – mseifert Feb 09 '17 at 05:08