mod_mono Control Panel

The latest release of Mono adds a little control panel to mod_mono, which I cooked up a while back. (Btw, thanks to Gonzalo for fixing it up and getting it in svn.) The control panel only lets you do one thing right now, which is restarting any mod-mono-server processes that it started. I use this whenever I update the code for GovTrack and need to have Mono reload the DLLs.

To activate the control panel at a URL, add something along these lines to your httpd.conf:

  SetHandler mono-ctrl  Order deny,allow  Deny from all  Allow from  [or your IP address]

The Order/Deny/Allow directives make sure that you’re the only one that can restart the server. You can also put these directives in a .htaccess file in the directory where you want the control panel to show up, but omit the tags. (Restart Apache after you put this in httpd.conf.)

Now you can visit http://yourservername/mono and you’ll see the control panel, with a link to restart the mod-mono-servers. Clicking the link immediately restarts the servers. (Not Apache, just the mod-mono-servers.)

For those running virtual hosts: If you’ve placed your Mono* directives for mod_mono all in VirtualHost sections, then you’ve already got separate mod-mono-server instances for each virtual host. The control panel will only see the mod-mono-server(s) for the virtual host that’s serving the page, so you could put different access controls on the control panel for different vhosts to allow different people to restart only the mod-mono-severs that they should be allowed to restart.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s