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

I've got outdated requests coming into a custom port (2104) on my server.

I've now setup my machine to handle those requests at:

But how can I redirect old requests coming in like that? (through httpd magic)

share|improve this question
up vote 2 down vote accepted

In your Apache config, you can make a VirtualHost for the port 2104 with a redirect to the proper URL.

Listen *:2104

<VirtualHost *:2104>
   Redirect 301 /

This is assuming your browser can follow redirects. If you need something fancy like a proxy, that's a different story.

share|improve this answer
@lunixbochs - I already have a Listen MYIPADDRESS:80 up top - what do i do? – siliconpi Jun 15 '11 at 6:05
You can listen to more than one port. For example, enabling SSL requires you to add a Listen 443 directive. I dropped this at the very end of a working httpd.conf on a server, restarted apache, and it just worked. You just need to make sure you don't have anything else running on port 2104 on that server anymore (because it'd conflict). – lunixbochs Jun 15 '11 at 6:06
@lunixbochs - so I just add another line just before the VirtualHost as you specified and it should work fine...? – siliconpi Jun 15 '11 at 6:26
The exact text I specified should be all you need. – lunixbochs Jun 15 '11 at 6:27
Hmm @lunixbochs - there are some additional factors. The URL being accessed is like: . This should be redirected to: – siliconpi Jun 15 '11 at 6:31

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.