krishna
krishna

Reputation: 837

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?

Upvotes: 1

Views: 505

Answers (3)

rsrajesh
rsrajesh

Reputation: 11

I can see at least two possible use cases for that:

  1. Assuming that your application is accessible to the public via port 80. But you wish to manage your database via phpmyadmin (a php tool to manage MySQL servers). Because of that you could configure Apache web server in a way, that it would listen on some other "private" port for phpmyadmin calls. This way, only you and your team can access it.

  2. When you don't have registered domain names with you, you can create multiple sites running on your server and assign different ports to different sites. This way, you could test your site until your domain name gets registered.

Upvotes: 1

Tiago Peczenyj
Tiago Peczenyj

Reputation: 4623

well... for http the default port is 80 and HTTPS default is 443

and you can serve in another port for some reason.

Upvotes: 0

Luka Ramishvili
Luka Ramishvili

Reputation: 899

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.

Upvotes: 1

Related Questions