0
|
1 <?xml version="1.0" encoding="LATIN1" ?> |
|
2 <!DOCTYPE webpage PUBLIC "-//Norman Walsh//DTD Website V2.2//EN" |
|
3 "http://docbook.sourceforge.net/release/website/2.2/website.dtd" [ |
|
4 <!NOTATION XML SYSTEM "xml"> |
|
5 <!ENTITY usage_desc_xml SYSTEM "usage_desc_xml.xml" NDATA XML> |
|
6 ]> |
|
7 <!-- $Id: usage_httpd.xml,v 1.2 2005/08/21 20:12:33 jerome Exp $ --> |
|
8 <webpage id="usage_httpd"> |
|
9 <config param="rcsdate" value="$Date: 2005/08/21 20:12:33 $"/> |
|
10 |
|
11 <head> |
|
12 <title>Web server configuration</title> |
|
13 <keywords>SAUTRET, BINS, album, gallery, photos, EXIF</keywords> |
|
14 </head> |
|
15 |
|
16 |
|
17 <webtoc/> |
|
18 <section> |
|
19 <title>Apache Configuration</title> |
|
20 |
|
21 <section> |
|
22 <title>Encoding</title> |
|
23 |
|
24 <para>The <filename>bins</filename> program will create |
|
25 automatically an <filename>.htaccess</filename> in the root |
|
26 directory of your album if the <literal>createHtaccess</literal> |
|
27 parameter is set to 1. This <filename>.htaccess</filename> is to |
|
28 be used by the <ulink url="http://httpd.apache.org/">Apache HTTP |
|
29 server</ulink> to set the correct encoding of the HTTP header |
|
30 according the html pages of the album.</para> <para>To allow |
|
31 Apache to use the <filename>.htaccess</filename> file, the |
|
32 following directive must be present in the |
|
33 <literal>Directory</literal> or <literal>VirtualHost</literal> |
|
34 of the Apache httpd configuration file : |
|
35 </para> |
|
36 <programlisting> |
|
37 AllowOverride All |
|
38 </programlisting> |
|
39 </section> |
|
40 <section> |
|
41 <title>Using BINS with PHP</title> |
|
42 |
|
43 <para>If you want that the .html extension file to be |
|
44 interpreted by PHP, you have to edit the |
|
45 <filename>.htacces</filename> file described in Encoding section |
|
46 and add the following lines : |
|
47 </para> |
|
48 <programlisting> |
|
49 AddHandler server-parsed .html |
|
50 AddType application/x-httpd-php .php .html |
|
51 </programlisting> |
|
52 <para> |
|
53 Thanks to Gilles Foucault for this Tip |
|
54 </para> |
|
55 </section> |
|
56 <section> |
|
57 <title id="usage_httpd.compression">Compression</title> |
|
58 <para> |
|
59 To reduce size of HTML and Javascript files you can enable |
|
60 compression on the web server. This is specially useful for |
|
61 the search engine because the |
|
62 <filename>search_data.js</filename> file, containing all the |
|
63 search data, can be very big on important album, but it |
|
64 compress very well. |
|
65 </para> |
|
66 <para> |
|
67 To enable compression on Apache 2, you have to enable |
|
68 <literal>mod_deflate</literal>. Then, in your virtual host configuration, add the following directives: |
|
69 </para> |
|
70 <programlisting> |
|
71 <![CDATA[ |
|
72 <IfModule mod_deflate.c> |
|
73 # Compression |
|
74 AddOutputFilterByType DEFLATE text/html text/plain \ |
|
75 text/xml text/css text/javascript application/x-javascript |
|
76 |
|
77 # Netscape 4.x has some problems... |
|
78 BrowserMatch ^Mozilla/4 gzip-only-text/html |
|
79 |
|
80 # Netscape 4.06-4.08 have some more problems |
|
81 BrowserMatch ^Mozilla/4\.0[678] no-gzip |
|
82 |
|
83 # MSIE masquerades as Netscape, but it is fine |
|
84 #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html |
|
85 |
|
86 # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48 |
|
87 # the above regex won't work. You can use the following |
|
88 # workaround to get the desired effect: |
|
89 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html |
|
90 |
|
91 # To see how compression perform |
|
92 DeflateFilterNote Input instream |
|
93 DeflateFilterNote Output outstream |
|
94 DeflateFilterNote Ratio ratio |
|
95 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate |
|
96 CustomLog /var/log/apache2/deflate.log deflate |
|
97 </IfModule> |
|
98 ]]> |
|
99 </programlisting> |
|
100 <para> |
|
101 See the <ulink |
|
102 url="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html">Apache |
|
103 documentation</ulink> for more details. |
|
104 </para> |
|
105 </section> |
|
106 </section> |
|
107 </webpage> |