Rails and Php on Apache without virtualhost

This is a simply hack to set up Apache with Ruby on Rails and PHP in the same tree.

I set up Apache+Rails following the wiki but then my php sites didn't work anymore, so I found this not for production way to have both together with a unique Apache installation and without virtual host(app1.host, app2.host).


cd /var/www
rails railstest
cd railstest
script/generate controller prova 
<VirtualHost *>
ServerName localhost
DocumentRoot /var/www/
ErrorLog /var/log/apache2/error.log

<Directory /var/www/railstest/public>
Options ExecCGI FollowSymLinks
AddHandler fcgi-script .fcgi
AllowOverride all
Order allow,deny
Allow from all


 Now restart apache and You will be able to access to your rails application with http://localhost/railstest/public/prova, if you don't want /public in the middle you can create symbolic links of public in /var/www (and call it railsapp)so You will be able to access to the controller with http://localhost/railsapp/prova and http://localhost/drupal-4.7-beta will work as usual

I've been surprised that ror on Apache is slower than  on Webrick(Ruby's webserver), I gonna try a real world solution.. probably this is a good point where to start.



Per esempio l'url sopra ti mostrerebbe il sorgente dell'applicazione
Una possibile soluzione potrebbe essere: accedere SOLO tramite link simbolico railsapp (e imboscare bene railstest)


dici che questa soluzione non è adatta ad un server in produzione ... perchè?