One virtual host slow, the others run fine

I am running the Apache2 server that comes with Mac OS Lion. All of my virtual hosts run great, except for one. I have checked to make sure all of the settings are the same for all of them, and they are.

/etc/hosts

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost therapeutichomecare uarts packthisstuff brandoncutrell sonnetrepertorytheatre genesis jameswebdevelopment jackievanderbeck sarahpramstaller angelreda stwilliam arcstages facesva robyneparrish singforyourseniors thebravecollection phpmyadmin
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost therapeutichomecare uarts packthisstuff brandoncutrell sonnetrepertorytheatre genesis jameswebdevelopment jackievanderbeck sarahpramstaller angelreda stwilliam arcstages facesva robyneparrish singforyourseniors thebravecollection phpmyadmin

/etc/apache2/extra/httpd-vhosts.conf

NameVirtualHost *:80

<VirtualHost *:80>
        DocumentRoot "/Users/barryhjames/Sites/genesis"
        ServerName genesis
        ErrorLog /private/var/log/apache2/genesis-error_log"
</VirtualHost>

I am thinking it might be something in my PHP code, but even on static HTML pages, the whole thing is running slowly for this one website.

Any ideas?

Anyone have any idea why this might be happening?!

Mikes,

I’ve never seen anything resembling the third and fourth lines as they don’t appear to be valid IP addresses.

Regards,

DK

I figured out that the two websites that are giving me problems are the only two that use header() functions. Is there something with the header function that might be causing the slow downs?

They both are IPv6, ::1 is the equivalent of 127.0.0.1
IPv6 for Dummies: There is no place like ::1

So should I remove the ::1 line?

No.

I’m still unsure why I am having an issue with headers and localhosg slowness.

Actually, I’d comment out the v6 lines and see if that helps. Suspecting IPv6 is misconfigured, but because v6 takes precedence it will try and do the v6 thing first then go v4.

l_e,

Thanks for that explanation.

Wyatt,

Ditto - and I would tend to agree (but I’ve got to go off and read the link logic_earth provided).

Regards,

DK

So I commented out the IPv6 lines, and it is still running slow. Here is the script that it is calling on… really just a simple PHP header redirect.


<?php
	header ("Location: concerts.php");
?>

I also tried this from a forum that I read, but it didn’t work, either.


<?php
	header ("Location: concerts.php");
?>
<html></html>

Any other thoughts?

Pull up a http debugger and see if generating the HTTP 302 redirect is slow, or concerts.php is slow. My bet is the latter.

I checked the HTTP headers, and the 302 was not slow. It actually said it loaded pretty quickly. It seems to hang up somewhere before the page is called.

So you need to figure out why concerts.php is slow.

But that’s what I’m saying. I have two sites that use the PHP header function, and they are the only two sites that are running slowly, so it has to have something to do with the PHP header function. Is there something in this function that is commonly making Apache servers run slowly? Possibly a setting that I would need to change? I have tried everything above to no avail.