Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

How can I open specific ports for my apache server under linux? I'm trying to build a connection with a online game that sends messages and receives to a specific port. I want to make my apache server/linux machine to listen to that specific port. bottom line, being able to receive/send data from/to that port

share|improve this question
Is this about allowing incoming connections to specific ports Apache is already listening to or are you asking about configuring Apache to listen on specific ports? Please provide information when asking questions - in its current state your question is too vague. – Marcin Kaminski Dec 1 '12 at 22:27
I changed the question. Hope it's clearer now. ty – Deus Deceit Dec 1 '12 at 22:41
up vote 0 down vote accepted

You can take a look at binding Apache to specific ports here.

I assume you're aware that you don't normally choose the port from which you're sending data, unless this is in a response to an already established connection.

For example, to make the server accept connections on both port 80 and port 8000, on all interfaces, use:

Listen 80
Listen 8000

To make the server accept connections on port 80 for one interface, and port 8000 on another, use

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.