0

Even after modifying the file /Library/Server/web/config/apache2/httpd_server_app.conf to include Listen 127.0.0.1:80 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

Sammy
  • 101
  • 2
  • 1
    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

1 Answers1

0

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 = 127.0.0.1) {
        rewrite ^ <a href="https://$host:81$request_uri">https://$host:81$request_uri? permanent; 
    }
Linztm
  • 391
  • 2
  • 7