Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

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

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


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.