Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

My OS:
Linux version 2.6.26-2-xen-686 (Debian 2.6.26-25lenny1) ( (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Fri Sep 17 00:54:08 UTC 2010

On my VPS, I need to use both php and ruby. So I want to use apache to handle my php sites and nginx for the ruby sites.
And pass the php request to apache through Nginx;
Then, I need to make apache bundle to another port except 80.

I have added 'Listen 8080' to /etc/ports.conf
and changed /etc/sites-enabled/000-default ( from [VirtualHost *:80] to [VirtualHost * : *])
and changed my virtual host ([VirtualHost * . *]);

Then restarted apache2

But when I request port 8080, it always direct me to the 80 port; I don't know why.
( Apache should not listen to 80 because I will make Nginx to listen to 80);

Any idea?

share|improve this question

migrated from Oct 8 '10 at 18:01

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

I have added 'Listen 8080'

Did you really add a new line to listen on an alternate port, or did you change the existing listen directive?

From a stock lenny configuration file all you should have to do is change these a couple lines. I have a script that changes the stock config to listening port to 8000, and these are the only lines that get changed. After that apache is restarted and you should be done. Verify by running netstat -ntlp and you should see that apache is only listening on the port you set.


NameVirtualHost *:8000
Listen 8000


<VirtualHost *:8000>
share|improve this answer
Thanks, I have fix it. The problem lies in my wordpress database and has no relationship with apapche2. – Croplio Oct 9 '10 at 3:29

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.