Changing the port in which apache starts

by rajesh 2007-05-16 08:15:28

Apache service by default uses the port 80. It listens for request on port 80.

When ever you type http://localhost or any domain name like, the request is sent to the respective server at port 80.

So, is equivalent to calling Both will give you the same result.

If required we can use a different port to start the apache server.

For starting apache in a different port, say 8080

Edit the httpd.conf file
E.g: Where httpd.conf will be present?
[in Windows]
C:\Program Files\Apache\Apache2.2\conf/httpd.conf

[in Linux]

in httpd.conf search for the line "Listen 80". Listen is the property that manages the port apache uses. Now change 80 to a different port say 8080


Listen 8080

Restart Apache for the configuration change to take effect. Now you can connect to the server by using the new port. To connect to the server use http://localhost:8080 or http://servername:8080

Tagged in:


You must LOGIN to add comments