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 search online and been reading documentation for Apache, Passenger, Rack, etc, but have yet to find a solution to my problem.

I have several Rack (ruby)-based apps, located in


app1 is a Sintra app, app2 is Padrino and app3 is Rails.

I would like to run these apps under different ports (assuming server IP is -> app1 -> app2   -> app3

What is the correct way to configure Apache's virtual host file to achieve this?

I have 3 files in /etc/apache2/sites-available/ with this type of configuration (with changed IPs):

<VirtualHost *:4567>
    RackEnv         production

    DocumentRoot    /home/web/sites/app1/public
    <Directory      /home/web/sites/app1/public>
        Order   allow,deny
        Allow   from all
        Options -MultiViews
        #AllowOverride All

But I cannot access app1 at (app3 does work on port 80, though).

share|improve this question
I'm assuming you mean port when you say IP as you haven't mentioned an IP other than What error do you receive when accessing Apache on either of the higher ports? and – Matt Aug 17 '12 at 8:28
That's correct, I stated that I want to run these apps under different ports with the same IP address. Accessing the ports in the browser, or pinging them times outs. – Arman H Aug 18 '12 at 7:51

You'll need to explicitly tell Apache to listen on those ports with the Listen directive; have a look at Binding to Addresses and Ports.

share|improve this answer
/etc/apache2/ports.conf contains the following directives: NameVirtualHost *:80 NameVirtualHost *:3000 NameVirtualHost *:4567 Listen 80 Listen 3000 Listen 4567 Relevant output for netstat -tulpn: tcp 0 0* LISTEN - tcp 0 0* LISTEN - tcp 0 0* LISTEN - tcp 0 0* LISTEN - – Arman H Aug 18 '12 at 7:52

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.