Create Per-Directory, Files or Location Options


I am trying to set an Apache directive from the Virtualmin control panel of User’s VPS but don’t know how to actually edit a directive or add an option to the directive once created.

In other words:

  1. I created a VPS at
  2. I login to the Virtualmin control panel for the recently created VPS (
  3. I created a new Apache Directive:
    Under Virtualmin - Services - Configure Website
    Create Per-Directory,Files or Location Options:
    Type Directory
    Regexp? Exact match
   Path: RailsEnv

These steps do indeed create a Directory Directive, I now what to add the following option to the directive but don’t know how to do so:

   RailsEnv development

If as sudo I amnually edit the apache virtual host conf file and add the directive option, everything works as I expected to. The problems is I don’t know how to add the directive option from the VPS Visrtualmin control panel.

Thanks in advance for all and any help


I’m not sure how to add it from the Configure Website GUI.

But, when you manually edit the Apache Virtual Host file – you’ll see the Directory directive that was added.

Is that something you could add into the template to use for all new Virtual Servers that get added?

You can tweak the template using:

System Settings -> Server Templates -> Apache Website – and you can tweak the template in the textarea at the top of the screen there.


Hi Eric,

First, thank you so much for replying. I followed your suggestion to change the templates and that would be indeed better than nothing at all which where I stand right now. I still think there must be a way to allow to enter directive details so that the individual users can add them or change them. The way you suggested at least I can get the directives in but individual users can not Edit Manually so they are stuck anyways.

Do you know how to allow users to Manually edit directives? I can find where to do so either.

After a lot of trial and error I finnaly got Ruby on Rails installed and working pretty good in a VPS using Phusion Passenger and this is the only missing part. After I discover how to do it I will post a blog so that others can benefit should they want to install a RoR app in virtualmin GPL.



Well, one option is to use .htaccess files.

The whole .htaccess realm exists entirely due to the problem you’re seeing right now :slight_smile:

Beyond that, I think Virtualmin attempts to limit how much say a user has in what goes into the Apache config. For example, a privileged user could use Services -> Configure Website -> Show Directives -> Edit Directives to manually make changes, but Virtualmin prevents most users from being able to make ad-hoc changes there due to security reasons.