top
logo


Home LAMP Apache Make Apache listen on a different port

Make Apache listen on a different port

PDF Print E-mail
(0 votes, average 0 out of 5)
Written by Alex Balyuk   
Thursday, 30 September 2010 04:38
multiple web servers

Sometimes it is necessary to run multiple web servers on 1 machine, especially in development environment. To accomplish this task you need to have web servers listen on different ports.

For example:

  • IIS - http://localhost:80
  • Apache 2 - http://localhost:81
  • TomCat - http://localhost:8080

I will show you how to make Apache listen to port 81 instead of default port 80.

 

Open apache configuration file, in most cases it is called httpd.conf.

Find the area below and change port # to available port number. I will use port # 81.

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 81

 

Also, you want to change the default server name

 
# 
# ServerName gives the name and port that the server uses to identify itself. 
# This can often be determined automatically, but we recommend you specify 
# it explicitly to prevent problems during startup. 
# 
# If your host doesn't have a registered DNS name, enter its IP address here. 
# 
ServerName localhost:81

 

Save changes and restart the web server.

After the web server is successfully restarted navigate to http://localhost:81/ and enjoy.

Last Updated on Thursday, 30 September 2010 05:02
 

Add comment


Security code
Refresh



Copyright © 2012 (bool) cast.com. All Rights Reserved.
Joomla!Joomla! is Free Software released under the GNU/GPL License.GNU/GPL License.

bottom
top
Site Map | Contact Us

bottom