My OS:
Linux version 2.6.26-2-xen-686 (Debian 2.6.26-25lenny1) (dannf@debian.org) (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?

migrated from stackoverflow.com Oct 8 '10 at 18:01

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


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>
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.