Search code examples
apachewebserverportlisten

why to have Apache Web Server listening on more than one port


What's use to have a Apache Web Server listening on more than one port?

Can any one explain me the use case?


Solution

  • You may want to use both IPv4 and IPv6, use HTTP and HTTPS, etc.

    http://httpd.apache.org/docs/2.2/bind.html

    You may have multiple network providers, and multiple IP's provided by each. Though listening to 0.0.0.0 will listen to all addresses, sometimes you may want to listen to selected addresses, not all of them.

    Edit: Forgot: also an important reason is when you have to serve multiple sites and multiple domains from one host (one IP). You will then use different ports for each different site. They are so called name-based virtual hosts.

    If you'll need it, here's a link on how to name-based virtual hosts from apache docs.