Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm running XAMPP on my Mac, which is just an Apache and MySQL server running as my local host. When I set it up, I found port 8000 (the default) was already taken (maybe by the Apache that ships inside OS X?) so I just reconfigured the httpd.conf file to tell it to listen on port 8080.

Anyhow, it all works, and I even have put in some settings in /etc/hosts so I can just type "mysite.local:8080" into my browser.

Here's the ONLY problem: often when going to fetch a page from the local host, my Mac takes a while (1-10 seconds) on the "sending request" or "looking up" step of retrieving the page, and then finally the page loads and renders. It's actually faster for me to access my production server (that is several states away!)... obviously that's absurd and my local server, all right here on the same machine, should be lightning fast. Any ideas why it's so slow, and how I can fix it?

share|improve this question
    
I took out your leading commentary regarding the relevance to this site. If you so desire us to migrate your question to another site, feel free to flag it and we will do so if on-topic and merited for the other site. –  Jason Salaz Mar 7 '12 at 16:52
    
Sure, thanks Jason. I put it there since I really genuinely don't know if this is more of a networking sort of question, or Apple-specific, or more about Apache, or what. (As a mod, what do you think?) I'm fine with it not being there... just trying to be smart about where I'm asking. –  Eric Mar 7 '12 at 16:55
    
I'm fine with it being here. It's software running on OS X, that pretty much makes it on-topic in a nutshell. Related to the actual question, could you post your /etc/hosts into the question? –  Jason Salaz Mar 7 '12 at 17:01
    
Have you tried turning off the anti phishing filters in your browser? They sometimes try to look up local domain names, struggle and won't stop it until some timeout stops it. –  Max Ried Mar 7 '12 at 17:36
add comment

1 Answer

up vote 2 down vote accepted

A few things:

  1. Apache built into OS X runs on port 80. If XAMPP couldn't start the web server erroring because port 8000 is in use, something is listening on that port already. You did one of the right things in reconfiguring XAMPP's Apache port, the other would be to find what's running on 8000 :).

  2. You're using the "Bonjour" name of your server, in theory. The mysite.local name. But if it's taking more than a second to resolve, then it is obviously browsing out to the internet in order to resolve the name to an address and come back inside.

If you know how, you can take the time to investigate your Bonjour settings. If you have Wide-Area Bonjour Browsing configured, but the server on the other end is not (or is no longer), these lookup delays are not completely impractical.

The quickest fix to this problem would just be to use localhost:8080 instead of mysite.local:8080, the longer one would be to trace where exactly your DNS lookup is heading too, and determining why a multi-second lookup is occurring.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.