MATLAB: Does the Simulink Web View not render correctly in Firefox when using an Apache web server and Simulink Report Generator 3.7 (R2009b)

iceweaselkonquerormozillaSimulink Report Generator

I have created a Simulink Web View for my model and I uploaded the files to my Apache web server. When I navigate to the HTML-file, the right part of my screen is almost blank (only navigation buttons) whereas I would expect to see the top level of my model. Also I notice a Javascript error:
svgState.svgDoc.rootElement is undefined
Further, I can then view my model by clicking on the correct node in the Explorer on the left, however certain features like zooming in and out using the mouse wheel do not work.

Best Answer

Firefox uses the MIME type (<http://en.wikipedia.org/wiki/Internet_media_type>) information which it receives from the server to determine how to render a certain document. Or if it does not receive this information from the server it tries to determine the type by itself based on the extension of the file.
An Apache server, by default, always sends this MIME type information. However, also by default, it will not be able to determine the correct MIME type information for SVG-files. Therefore the combination of Apache + Firefox can lead to SVG-files not being rendered correctly.
So what we would need to do is teach Apache which MIME type information to send for SVG-files. This can be done in two ways:
======================================
By using a local .htaccess file
======================================
Simulink Web View will automatically generate such an .htaccess for you, which you should simply upload to the same location as your SVG-files. However, you should know that your Apache server must allow you to actually use .htaccess files for this to work. If you are the administrator of the Apache server the following instructions show you how to allow .htaccess files to be used (or if you are not the administrator, contact the administrator and show him/her the following):
1. Locate and open your server's httpd.conf file (on Linux systems often found in /etc/httpd/conf).
2. In the configuration file scroll down to the "Directory" section for the directory in which you uploaded your Simulink Web View Files. Within this section find the line which starts with "AllowOverride", for example:
AllowOverride None
If listed remove the "None" option. Then add the "FileInfo" option (if other options are already listed you can keep those). If you could not find the "AllowOverride" line, create one. The line might now look like:
AllowOverride FileInfo
More information about the AllowOverride options can be found in the Apache documentation:
The whole "Directory" section (without comment lines) might now look something like:
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride FileInfo
Order allow,deny
Allow from 172.16.59.0/255.255.255.0
</Directory>
3. Save the modified httpd.conf.
4. Restart the web server (on Linux often: "/etc/init.d/httpd restart").
======================================
By adding the MIME types to the server wide configuration
======================================
You need to be the server's administrator to be able to do this (or you could ask your administrator to do this for you):
1. Locate and open your server's httpd.conf file (on Linux systems often found in /etc/httpd/conf).
2. Add the following three lines to the end of the file:
AddType image/svg+xml .svg
AddType image/svg+xml .svgz
AddEncoding gzip .svgz
3. Save the modified httpd.conf.
4. Restart the web server (on Linux often: "/etc/init.d/httpd restart").
======================================
Further Notes
======================================
You may need to clear your Firefox cache before the changes are noticable in your web browser.
To verify that the correct MIME type is reported to Firefox. Navigate to your Simulink Web View site. Right-click in the right pane and select "This Frame" -> "View Frame Info". Look under "Type", if correctly configured it should read "image/svg+xml".