3

What I am trying to do is to create multiple ruby apps in one Apache directory and when I go to http://localhost/appname the ruby app resolves without problems. However, I want to do this dynamically so I do not have to add a new <Directory> in apache.conf every time I create a new app. I would like it to be like PHP in Apache where you just put multiple apps in the directory and http://localhost/appname shows the app

apache.conf

<VirtualHost *:80>
    UseCanonicalName Off
    ServerName localhost
    ServerAlias localhost
    ServerAdmin webmaster@localhost
    VirtualDocumentRoot /var/www/html/*/public

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html/*/public>
        Require all granted
        Options Indexes FollowSymlinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

If I set document root and directory to the full path of the app everything works, but I want to make it dynamic.

Is this even possible? If so, would you be able to provide some help?

Thanks!

0 Answers0