Раздел 10. Apache modules Пункты: 85 86 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 163 164 165 166 167 168 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 203 204 205 206 207 208 209 210 211 212 213 RU EN Пункт 165. Apache Module mod_mime_magic
SummaryThis module determines the MIME
type of files in the same way the Unix
This module is derived from a free version of the
Format of the Magic FileThe contents of the file are plain ASCII text in 4-5
columns. Blank lines are allowed but ignored. Commented lines
use a hash mark (
For example, the following magic file lines would recognize some audio formats: # Sun/NeXT audio data 0 string .snd >12 belong 1 audio/basic >12 belong 2 audio/basic >12 belong 3 audio/basic >12 belong 4 audio/basic >12 belong 5 audio/basic >12 belong 6 audio/basic >12 belong 7 audio/basic >12 belong 23 audio/x-adpcm Or these would recognize the difference between # Frame 0 string \<MakerFile application/x-frame 0 string \<MIFFile application/x-frame 0 string \<MakerDictionary application/x-frame 0 string \<MakerScreenFon application/x-frame 0 string \<MML application/x-frame 0 string \<Book application/x-frame 0 string \<Maker application/x-frame # MS-Word 0 string \376\067\0\043 application/msword 0 string \320\317\021\340\241\261 application/msword 0 string \333\245-\0\0\0 application/msword An optional MIME encoding can be included as a fifth column. For example, this can recognize gzipped files and set the encoding for them. # gzip (GNU zip, not to be confused with # [Info-ZIP/PKWARE] zip archiver) 0 string \037\213 application/octet-stream x-gzip Performance IssuesThis module is not for every system. If your system is barely keeping up with its load or if you're performing a web server benchmark, you may not want to enable this because the processing is not free. However, an effort was made to improve the performance of
the original NotesThe following notes apply to the mod_mime_magic: MIME type lookup via file magic numbers This software was submitted by Cisco Systems to the Apache Group in July 1997. Future revisions and derivatives of this source code must acknowledge Cisco Systems as the original contributor of this module. All other licensing and usage conditions are those of the Apache Group. Some of this code is derived from the free version of the file command originally posted to comp.sources.unix. Copyright info for that program is included below as required. - Copyright (c) Ian F. Darwin, 1987. Written by Ian F. Darwin. This software is not subject to any license of the American Telephone and Telegraph Company or of the Regents of the University of California. Permission is granted to anyone to use this software for any purpose on any computer system, and to alter it and redistribute it freely, subject to the following restrictions:
For compliance with Mr Darwin's terms: this has been very significantly modified from the free "file" command.
MimeMagicFile Directive
The ExampleMimeMagicFile conf/magic Пункты: 85 86 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 163 164 165 166 167 168 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 203 204 205 206 207 208 209 210 211 212 213 |
![]() |