Web server configuration

Introduction Examples FAQ Download Installation Usage Creating an album Setting description fields Customization Web server configuration Tools Contact and contribution License | # Web server configuration ## Apache Configuration ### Encoding The `bins` program will create automatically an `.htaccess` in the root directory of your album if the `createHtaccess` parameter is set to 1. This `.htaccess` is to be used by the Apache HTTP server to set the correct encoding of the HTTP header according the html pages of the album. To allow Apache to use the `.htaccess` file, the following directive must be present in the `Directory` or `VirtualHost` of the Apache httpd configuration file :
    	  AllowOverride All
### Using BINS with PHP If you want that the .html extension file to be interpreted by PHP, you have to edit the `.htacces` file described in Encoding section and add the following lines :
    	AddHandler server-parsed .html
    	AddType application/x-httpd-php .php .html
Thanks to Gilles Foucault for this Tip ### Compression To reduce size of HTML and Javascript files you can enable compression on the web server. This is specially useful for the search engine because the `search_data.js` file, containing all the search data, can be very big on important album, but it compress very well. To enable compression on Apache 2, you have to enable `mod_deflate`. Then, in your virtual host configuration, add the following directives:
            <IfModule mod_deflate.c>
                    # Compression
                    AddOutputFilterByType DEFLATE text/html text/plain \
                            text/xml text/css text/javascript application/x-javascript

                    # Netscape 4.x has some problems...
                    BrowserMatch ^Mozilla/4 gzip-only-text/html

                    # Netscape 4.06-4.08 have some more problems
                    BrowserMatch ^Mozilla/4\.0[678] no-gzip

                    # MSIE masquerades as Netscape, but it is fine
                    #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

                    # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
                    # the above regex won't work. You can use the following
                    # workaround to get the desired effect:
                    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

                    # To see how compression perform
                    DeflateFilterNote Input instream
                    DeflateFilterNote Output outstream
                    DeflateFilterNote Ratio ratio
                    LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
                    CustomLog /var/log/apache2/deflate.log deflate
            </IfModule>
See the Apache documentation for more details.

$Date: 2005/08/21 20:12:33 $ | Home |
Copyright © 2001, 2005, Jérôme SAUTRET.