Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
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 Answer 1

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; 
    }
share|improve this answer

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.