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.

I have default Listen 80 in httpd.conf. Sometimes I need my own webapp to run on that port so I run it with sudo. So, first I need to change Apache port to something else. What I am looking for is a quick one click action to switch in forth and back.

Please advise.

share|improve this question

1 Answer 1

You can't.
In order to change the port(s) or address(es) the web server is listening on you must change the web server configuration and restart the web server.


I think your best options are:

  • Using mod_proxy to pass your app through Apache
    Have your app listen on some other port and configure mod_proxy appropriately

  • Have both Apache and your app listen on different ports and use a third application to listen on port 80 and forward the requests to the appropriate service.
    Basically writing your own socket-bouncing proxy.

Writing that socket-bouncing proxy (or configuration of mod_proxy) is left as an exercise for the reader - mainly because I don't know your internal requirements.

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.