ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Apache2 + Passenger : any experts ? Some issues with different VirtualHosts on same server

Added by Wiki Bit at 2012-01-25 11:57 am

Hi,

moved chiliproject to a production server, however, there are 2 other ruby applications (Ruby/Sinatra) which need to run on that same server, so I'm looking at 2 choices :
- run those apps also with the combo Apache2/Passenger
or
- run those apps with thin, and proxy them using apache2
the idea is to run them as follows:

chiliproject : http://x.x.x.x/chili
app1 : http://x.x.x.x/ (so this would be the main app)
app2 : http://x.x.x.x/app2
all on port 80

the issue I'm having is with the virtualhost config

at this moment, I've following as "sites-enabled" :

#cat default

<VirtualHost *.80 *:8080 *:8083 *:8084 *:8085 *:8090 *:8888>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/" 
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

and

#cat chiliproject

# Specific config for chiliproject
# /var/www/chili is linked to /opt/chiliproject/public
   PassengerPoolIdleTime 0
   ServerName Chili
   DocumentRoot /var/www

   <Directory /var/www/chili>
    RailsBaseURI /chili
        PassengerResolveSymlinksInDocumentRoot on
    PassengerMinInstances 3
   </Directory>

   PassengerPreStart http://127.0.0.1/chili

this setup works now

BUT

the moment I change or add to chilliproject to this :

# Specific config for chiliproject
# /var/www/chili is linked to /opt/chiliproject/public
<VirtualHost *:80>
   PassengerPoolIdleTime 0
   ServerName Chili
   DocumentRoot /var/www

   <Directory /var/www/chili>
    RailsBaseURI /chili
        PassengerResolveSymlinksInDocumentRoot on
    PassengerMinInstances 3
   </Directory>

   PassengerPreStart http://127.0.0.1/chili
</VirtualHost>

I get a page not found for /chili

checking the logs, I can see the entry

[Wed Jan 25 12:54:16 2012] [error] [client x.x.x.x] File does not exist: /etc/apache2/htdocs

so somwhere the redirection gets messed up?
either I'm just looking over something stupid, or missing it, or forgetting a setting?
so I guess I need to resolve that, before adding the config for the other 2 apps I want to run
does anyone have an idea or experience with Apache2/Passenger for this?

thanks

WB