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

EDIT: I would like to open 8080 and 1337 ports on my computer, how can I do it? how can I check that the apache server listen on 8080?

For a laboratory work, I am using apache2.2 server, I need to open port 8080 and 1337 on this server, I am told that I need to open it by changing httpd.config file in C:\Program Files\Apache Software Foundation\Apache2.2\conf. I see that I can edit it by opening with notepad. Can anybody tell me what to edit in httpd.config to open these ports?

share|improve this question
You open ports on the firewall. You make Apache listen on specific ports. Please clarify which you want. – Ben Pilbrow Oct 23 '11 at 13:07
@Johan, please don't take any further advise from the person who told you this. – John Gardeniers Oct 24 '11 at 1:39

You want the "listen" directive.

share|improve this answer

The Listen directive is what you need. You should have a file called ports.conf in your Apache folder (on Windows) or under /etc/apache2/. If you wanted to configure Apache to listen on ports 8080 and 1337, you'd add:


This would cause Apache to listen on all interfaces. If you just want Apache to listen on a single IP address, you'd add:


To verify Apache listens on that port, you could use a telnet session, like so (assuming is the server's IP address):

telnet 8080

If you get some output, the server listens to that port.

share|improve this answer
About that telnet, you'd have to type an HTTP request to get any output. Like "GET / HTTP/1.0" + Enter + Enter. And on Windows telnet, you have to type that blind. And without any typo. You can simply point a browser to instead. – korkman Oct 23 '11 at 21:16
Well. As soon as you get a prompt, telnet has successfully connected to the web server. He asked about how to test if a web server listens to that port, not if the web server serves something useful. – Daniel Oct 24 '11 at 6:32

In your apache basedir e.g. /etc/apache2 you'll find a ports.conf file. Edit it following the description here ->

besides that you certainly have to add the port settings also to you virtual hosts in order to get them run behind this port...

share|improve this answer

If you are new to Apache, I recommend using a tool to edit the httpd.conf, rather than messing with the file.

Here is one:

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.