Add "html" to parsed files list

hmmmm. I’m lost again, I could have sworn I saw the place to add the list of files Apache should parse for server side includes in the VirtualMin GUI… I want shtml and html both to be parsed… I can edit httpd.conf directly of course, but I would like to learn my way around VirtualMin if I can find it in the GUI.


If you were doing it by hand, you’d need to make sure that the “mime” module had the following added to it’s config (which, on Debian/Ubuntu, is in /etc/apache2/mods-enabled/mime.conf):

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

And within each VirtualHost that you wanted to use SSI, you’d want to add “+Includes” to the “Options” line.

To do that in Virtualmin, you’d enable the mime stuffs in Webmin -> Servers -> Apache, go into Edit Config Files, and make sure the previous lines are in mime.conf (they may be in there by default, I forget).

You can also use that same Edit Config Files section to add +Includes to any existing domains – or to make it available to new domains, you’d want to add it to the Server Template.

That’s back in Virtualmin -> System Settings -> Server Templates -> Default -> Apache Website – and add that to the “Options” line in the textarea there.

There’s not a magical “Virtualmin” incantation for this, or any other, behavior. We parse the configuration files and work on them directly–so, editing httpd.conf directly is entirely fair game, and it won’t give Virtualmin indigestion. If you find it easier to hit the files, go for it. All we want is for you to be more productive–we don’t care whether you use the “right way”.

For server-wide behavior, hitting the file directly is fast, simple and safe (assuming you know how to do it that way). I could have sworn there was a way to do it in Webmin->Servers->Apache Webserver, but I’m not seeing it except in the per-host configuration sections. These options are available at the server level, so there’s no reason Webmin should expose them at that level. I’ll ask Jamie to clarify on that point.

Anyway, to change this behavior per-server within Virtualmin, you can select the virtual server to which you’d like it to apply, and then open up Services->Configure Website. From there, you’ll first want to turn on Server Side Includes in the Document Options page (look in the section labeled “Directory options”). If you need SSI to be able to execute scripts, you’ll need to turn on the “and execs” option.

Next, you’ll need to tell Apache when to use SSI. By default, it’s going to probably only apply to .shtml files (this depends on your OS and package, as to what is enabled by default, but I’m certain .html won’t be getting SSI treatment, by default, on any OS).

There are two options for this. The best option, probably, is the XBitHack option. This one is set in the CGI Programs page (still under Configure Website). The option is labeled "Process includes on files with execute bit?"

The other option is to add handlers for .shtml and .html using the AddHandler directive. This can be done on the MIME Types page (still in Configure Website). You’d certainly need to add at least a handler for .html, and you may also need to add a type and a handler for .shtml.

The advantage to the XBitHack (the “Process includes on files with the execute bit?”) method is that Apache doesn’t have to process HTML files that aren’t executable, which is dramatically more efficient. But, if you’re coming from a server that was processing all files, and they don’t have the execute bit set, then this will be as tedious as renaming all of the files to .shtml, because you’ll have to go through and set all of the files execute bit.

OK, It appears i had gone thru this once before on another site and just forgot… I turned on the Serverside includes under Document options and then added the handler server-parsed .html in the Mime types and it works…

case closed