Question: We are about to roll out several hundred new machines running Windows 7 x64, with the OS installed via [WDS](http://en.wikipedia.org/wiki/Windows_Deployment_Services) so at the moment we can make changes and [sysprep](http://en.wikipedia.org/wiki/Sysprep) them into the build.

The problem is a .NET application we wrote years ago which itself spawns a modified command shell. That shell runs a [DataFlex](http://en.wikipedia.org/wiki/DataFlex) (DataFlex 3.2 dfruncon) application that itself needs to run with elevated permissions.

We don't grant users any general administrator rights.

Is there a mechanism where we can pre-allow our .NET application to run as administrator so that the command control runs as Administrator?

I'm aware of the changes I can make in the `app.manifest` file to require that the program runs as Administrator. I'm not aware of how I can (as an Administrator) configure the machine to allow that to happen without giving the user more rights or credentials than I would want them to have. Is there something the equivalent of [CasPol](http://msdn.microsoft.com/en-us/library/cb6t8dtz%28v=vs.80%29.aspx) to allow me to specify that a given EXE file can run as administrator? If not, how on earth would I go about figuring out exactly what rights the user needs to have to allow DataFlex's dfruncon to run?

Answer: 
So, keeping your existing LAMP stack serving example1.com,, do the following to set up the Rails side on example2.com:

Run mongrel to listen on port 8000 (or whatever) (FWIW, we use Unicorn, which will handle the workers more elegantly).

On the Apache side, do something like this configuration:

```
<VirtualHost example2.com:80>
    ServerName example2.com

    ProxyPass / http://localhost:8000/
    ProxyPassReverse / http://localhost:8000
    ProxyPreserveHost on
</VirtualHost>

```

You should peruse your Apache documents on "reverse proxy" and the "ProxyPassReverse" directive for specific details and gotchas.

So, your existing VirtualHost for example1.com will handle the LAMP stuff, and the VirtualHost for example2.com will proxy requests over to your Rails stack. Your Rails server will listen on port 8000, which is out of the way from LAMP.
They can run alongside each other perfectly happily.