Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Even after modifying the file /Library/Server/web/config/apache2/httpd_server_app.conf to include Listen line, I'm unable to have Apache on Mountain Lion Server listen to the localhost IP only. I need Apache to host only internal websites, while running nginx side by side to respond to external IP. Any idea?

Thanks in advance, Sammy

share|improve this question
You can't have two processes listening to the same port. You have to pick one to listen, and then feed to the other one on an alternate port if necessary. – John Nov 27 '12 at 15:35
Well then how can I make apache listen to different ports? Apple seems to have completely locked it. I can't even delete their default website. – Sammy Nov 27 '12 at 21:08

You could easily have nginx running on port 80 which is responding to all requests. Once a connection from localhost has been made, you could route that request to a port running Apache.

In your server directive:

    if ($remote_addr = {
        rewrite ^ <a href="https://$host:81$request_uri">https://$host:81$request_uri? permanent; 
share|improve this answer

Your Answer


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.