1. ホーム
  2. python

djangoのapacheへのデプロイメント

2022-02-19 14:09:32

インターネット上には、djangoをapacheにデプロイする記事がかなり多くありますが、皆さんの運用によると、一度でうまくいかなかったり、問題が発生したりしたようなので、主なケースを紹介します。

<スパン 1. ウェブで見つけたmod_wsgiのバージョンが間違っていて、ダイナミックライブラリが読み込まれない。

2. 設定の問題、apache, python, mod_wsgi のバージョンが関係するため、設定が全く同じにならない可能性があります。

ここでは、私が遭遇した問題と解決策をより詳しく書いています。失敗体験は読み飛ばしても大丈夫です。


<スパン 失敗の経験

私の環境はpython2.7.11 64ビット版であり、私は2.4.20x 64ビット版です選択したApacheは、ここでポイントは、Apacheとpythonのバージョンが同じ(とコンパイルアウト同じコンパイラを使用するには、一般的にはpython2.xバージョンとvc9でコンパイルされている必要があり、それはVS2008であり、我々はそれをダウンロードするには以下のリンクにアクセスしてくださいコンパイルしたmod_wsgiのを選択すると、保証しなければなりませんされています。

http://www.lfd.uci.edu/~gohlke/pythonlibs#mod_wsgi

私もダウンロードしましたが、失敗しました。

失敗の原因は、私のマシンにはpython 2.7 32bitがインストールされていると思っていたのですが、実は64bitだったということです。そこで、様々なバージョンのwhlファイルを展開し、mod_wsgi.soファイルを一つずつ置き換えていったのですが、やはり失敗してしまいました。バージョンがない、私はまだ様々なダウンロードのapacheのバージョンをコンパイルしたくない、それはまだ右ああではないことが判明?それはあなたが怠惰ああすることはできませんので、私は自分のコンピュータがVS2008にインストールされていないので、私はVS2008をダウンロードし、ここで64ビットコンピュータのインストールでVS2008に特別な注意をVC64ビットコンパイラがインストールされていないようですが、あなたは64ビットpythonを使用する場合、VC64ビットコンポーネントを確認してください、それ以外の場合は(私はデフォルトでそれをインストールするので、私はそのvcvarsall.bat amd64コンポーネントがインストールされていないエラーが報告されました)されていることが分かった。VS2010は、64ビットコンピュータにインストールすると、デフォルトで64ビットコンパイラがインストールされます。

<スパン

<スパン 詳細手順(ご自身でコンパイルしてください)

<スパン 1. 環境について紹介します。 

python2.7.11 64ビット

apache 2.4.20 64ビット VC9コンパイル版

あなたのpython 2.xがどのバージョンのvcでコンパイルされているか時々混乱するかもしれないことを明確にするために、コマンドラインから直接pythonを実行してください、今回はそのpythonの詳細なバージョン情報を表示します、同様にコンパイラとコンパイラバージョン、次のように、それは私のものです。


<スパン MSCはMicrosoftのコンパイラv.1500でコンパイルされていると書いてあります。ここで、知らない人もいるかもしれませんが、前回のpythonのコンパイラ対応についての投稿を参照してください。V1500はVC9コンパイラのバージョンを表しているので、私のバージョンのpythonはここではvc9でコンパイルされていることは間違いありません。これにより、pythonとapacheは同じコンパイラ(同じバージョン)でコンパイルされていることが確認できます。


<スパン 2. mod_wsgi のソースコードをダウンロードする

ソースコードと聞くと、中国ではgithubしかダウンロードできないと推測されますが、確かにmod_wsgiのコードはgithubの以下のアドレスにホストされています。

https://github.com/GrahamDumpleton/mod_wsgi


<スパン 3. コンパイル

<スパン ダウンロードした mod_wsgi-develop.zip を以下の場所に展開します。 mod_wsgi-develop フォルダを開き、win32フォルダを開くと、以下のようなディレクトリ構成になっています。


<スパン ap24py27-win32-VC9.mk ファイルを開きます。(ここで、環境に合わせてコンパイルする mk ファイルを選択します。)

APACHE_ROOTDIR = c:\Apache24-win64-VC9

PYTHON_ROOTDIR = c:\Python27-win64-VC9
PYTHON_VERSION = 27

include common-VC9.mk


APACHE_ROOTDIR と PYTHON_ROOTDIR を実際の場所に変更します。
例えば、私の環境は以下のような感じです。

APACHE_ROOTDIR = E:\windows_softs\apache64\Apache24

PYTHON_ROOTDIR = c:\Python27
PYTHON_VERSION = 27

include common-VC9.mk


この時点で、対応するバッチを使って直接コンパイルすればよいのですが、私の環境ではbuild-win64-vc9.batを選びました。

<スパン または、vs2008のビルドコマンドラインを開く(64bitの場合はx64互換のコマンドラインを選択する)。


開いて、ソースディレクトリにcdして、次のようにします。

nmake /f ap24py27-win64-VC9.mk clean

nmake /f ap24py27-win64-VC9.mk install

<スパン これで終わりです。コンパイルしていない場合は、コンパイルした出力を見て、pythonやapacheのディレクトリが正しく指定されていないかどうか確認してください。

4. apacheの設定

コンパイル後、mod_wsgi.so ファイルは自動的に apache/modules ディレクトリにコピーされるので、この時点で設定を行うだけでよいでしょう。

を設定する際に、設定しなければならない重要なパラメータがいくつかあります。

<1> モジュールの追加

LoadModule wsgi_module modules/mod_wsgi-py27-VC9.so



<2> python の場所を指定します(指定しない場合、apache の error.log は ImportError を報告します)。No module named site エラー)

WSGIPythonHome C:/Python27


<3>django アプリケーションを構成する

# Specify the path to the wsgi.py configuration file for the myweb project
WSGIScriptAlias / G:/localsvn/trunk/python/django/myblog/myblog/wsgi.py

# Specify the project path
WSGIPythonPath G:/localsvn/trunk/python/django/myblo

<Directory G:/localsvn/trunk/python/django/myblog>
<Files wsgi.py>
    Require all granted
</Files>
</Directory>

#Configure the static directory, you need to turn off debug mode in django's settings, and specify STATIC_ROOT, the same as this directory
# If you need to, you can configure the upload directory MEDIA_ROOT, which corresponds to MEDIA_URL
Alias /static G:/localsvn/trunk/python/django/myblog/myblog/static
<Directory G:/localsvn/trunk/python/django/myblog/myblog/static> 
    AllowOverride None
    Options None
    Require all granted
</Directory>


# This is the main Apache HTTP server configuration file.
# This is the main Apache HTTP server configuration file.
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
In particular, see # <URL:; # for a discussion of each configuration directive.
# Do NOT simply read the instructions in here without understanding # what they do.
Do not simply read the instructions in here without understanding # what they do. They're here only as hints or reminders.
# You have been warned.  
#You have been warned.
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" 
# will be interpreted as '/logs/access_log'.
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which httpd.exe is located
# It is recommended that you always supply
# an explicit drive letter in absolute paths to avoid confusion.

#It is recommended that you always supply an explicit drive letter in absolute paths to avoid confusion.
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
# ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept.
# Do not add a slash at the end of the directory path.
# ServerRoot at a non-local disk, be sure to specify a local disk on the
If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used.
# same ServerRoot for multiple httpd daemons, you will need to change at
# at least PidFile.
#Define SRVROOT &qu

Define SRVROOT "E:/windows_softs/apache64/Apache24"
ServerRoot "${SRVROOT}"

#
# Mutex: Allows you to set the mutex mechanism and mutex file directory
# for individual mutexes, or change the global defaults
# Uncomment and change the directory
# Uncomment and change the directory if mutexes are file-based and the default
# mutex file directory is not on a local disk or is not appropriate for some
# other reason.
#
# Mutex default:logs

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# See also the <VirtualHost>
# directive.
See also the <VirtualHost> # directive.
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
# Listen to specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses.
# Listen 12.34.56.78:8000
Listen 8000

# Listen 8000
# Dynamic Shared Object (DSO) Support
# # To be able to use the functi
# To be able to use the functi
#map /static to disk path<span style="font-family: Arial, Helvetica, sans-serif;">G:/localsvn/trunk/python/django/myblog/myblog /static</span>
<span style="font-family:Arial, Helvetica, sans-serif;">#If you have an upload directory, which is django's MEDIA_ROOT, you can also configure it like this (path mapping, given permissions)
</span>Alias /static G:/localsvn/trunk/python/django/myblog/myblog/static
<Directory G:/localsvn/trunk/python/django/myblog/myblog/static> 
    AllowOverride None
    Options None
    Require all granted
</Directory>

#
# Deny access to the entirety of your server's filesystem.
# explicitly permit access to web content directories in other 
# <Directory> blocks below.

# <Directory> blocks below.
# <Directory />
# AllowOverride none
# Require all denied
# </Directory>

#</Directory> #
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

# DocumentRoot: The directory out # of which you are a member.
# DocumentRoot: The directory out of which you will serve your
# By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    # The Options directive is both complicated and important.
    Options Indexes FollowSymLinks

    # AllowOverride controls what directives may be placed in .htaccess files.
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    # AllowOverride None
    AllowOverride None

    #AllowOverride None
    # Controls who can get stuff from this server.
    # AllowOverride None
    Require all granted
</Directory>

# DirectoryIndex: sets the file that Apache will serve if a directory.
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

# The following lines prevent .htaccess.
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<Files ".ht*">
    Require all denied
</Files>

# <ErrorLog: The location of the
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# If you *do* define an error logfile for a <VirtualHost>. container, that host's error messages relating to that virtual host will be logged here;
# container, that host's errors will be logged there and not here.
#
ErrorLog "logs/error.log"

# LogLevel: Control the number of errors.
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
# LogLevel
LogLevel warn

<IfModule log_config_module>
    # The following directives define some format
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat 
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    # ScriptSock
    # Scriptsock logs/cgisock
</IfModule>

#
# "${SRVROOT}/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "${SRVROOT}/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    # AddType
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    # AddType application/x-gzip .tgz
    # AddEncoding
    # AddEncoding allows you to have certain browsers uncompress
    # Note: Not all browsers support this.
    #Note: Not all browsers support this.
    # AddEncoding x-compress .Z
    # AddEncoding x-gzip .gz .tgz
    #Z
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #.tgz
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    These can be either built into the server # or added with the Action directive (see below).
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    # AddHandler cgi-script .cgi .pl

    # For type maps (negotiated resources):
    #AddHandler type-map var

    # AddHandler type-map var
    # Filters allow you to process content before it is sent to the client.
    # To parse .shtml
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    # AddType text/html .shtml
    # AddOutputFilter INCLUDES .shtml
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.
# directive tells the module where the hint definitions are located.
The MIMEMagicFile # directive tells the module where the hint definitions are located.
# MIMEMagicFile conf/magic

#conf/magic
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
# # MIMEMagicFile conf/magic
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# MaxRanges: Maximum number of Ranges in a request before
# returning the entire resource, or one of the special
# values 'default', 'none' or 'unlimited'.
# Default setting is to accept 200 Ranges.
#MaxRanges unlimited

#MaxRanges unlimited.
# EnableMMAP and EnableSendfile: On systems that support it, 
# memory-mapping or the sendfile syscall may be used to deliver
# This usually improves server performance, but must
# be turned off when serving from networked-mounted 
# filesystems or if support for these functions is otherwise
This usually improves server performance, but must # be turned off when serving from networked-mounted # filesystems or if support for these functions is otherwise broken on your system.
# Defaults: EnableMMAP On, EnableSendfile Off
# EnableMMAP On, EnableSendfile Off
#EnableMMAP off
# EnableSendfile on

#AcceptFilter http none
#AcceptFilter https none

# Supplemental configuration
# Supplemental configuration
# The configuration files in the conf/extra/ directory can be 
# included to add extra features or to modify the default configuration of 
# the server, or you may simply c



設定後、apacheサーバを起動し、djangoの管理者URLに直接アクセスできれば、設定成功です。また、apache のデフォルトのポートは 80 ですので、必要であればそれを設定することができます。

私の完全な設定ファイルを添付します。

# This is the main Apache HTTP server configuration file.
# This is the main Apache HTTP server configuration file.
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
In particular, see # <URL:; # for a discussion of each configuration directive.
# Do NOT simply read the instructions in here without understanding # what they do.
Do not simply read the instructions in here without understanding # what they do. They're here only as hints or reminders.
# You have been warned.  
#You have been warned.
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" 
# will be interpreted as '/logs/access_log'.
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which httpd.exe is located
# It is recommended that you always supply
# an explicit drive letter in absolute paths to avoid confusion.

#It is recommended that you always supply an explicit drive letter in absolute paths to avoid confusion.
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
# ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept.
# Do not add a slash at the end of the directory path.
# ServerRoot at a non-local disk, be sure to specify a local disk on the
If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used.
# same ServerRoot for multiple httpd daemons, you will need to change at
# at least PidFile.
#Define SRVROOT &qu

Define SRVROOT "E:/windows_softs/apache64/Apache24"
ServerRoot "${SRVROOT}"

#
# Mutex: Allows you to set the mutex mechanism and mutex file directory
# for individual mutexes, or change the global defaults
# Uncomment and change the directory
# Uncomment and change the directory if mutexes are file-based and the default
# mutex file directory is not on a local disk or is not appropriate for some
# other reason.
#
# Mutex default:logs

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# See also the <VirtualHost>
# directive.
See also the <VirtualHost> # directive.
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
# Listen to specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses.
# Listen 12.34.56.78:8000
Listen 8000

# Listen 8000
# Dynamic Shared Object (DSO) Support
# # To be able to use the functi
# To be able to use the functi

#map /static to disk path<span style="font-family: Arial, Helvetica, sans-serif;">G:/localsvn/trunk/python/django/myblog/myblog /static</span>

<span style="font-family:Arial, Helvetica, sans-serif;">#If you have an upload directory, which is django's MEDIA_ROOT, you can also configure it like this (path mapping, given permissions)
</span>Alias /static G:/localsvn/trunk/python/django/myblog/myblog/static
<Directory G:/localsvn/trunk/python/django/myblog/myblog/static> 
    AllowOverride None
    Options None
    Require all granted
</Directory>

#
# Deny access to the entirety of your server's filesystem.
# explicitly permit access to web content directories in other 
# <Directory> blocks below.

# <Directory> blocks below.
# <Directory />
# AllowOverride none
# Require all denied
# </Directory>

#</Directory> #
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

# DocumentRoot: The directory out # of which you are a member.
# DocumentRoot: The directory out of which you will serve your
# By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    # The Options directive is both complicated and important.
    Options Indexes FollowSymLinks

    # AllowOverride controls what directives may be placed in .htaccess files.
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    # AllowOverride None
    AllowOverride None

    #AllowOverride None
    # Controls who can get stuff from this server.
    # AllowOverride None
    Require all granted
</Directory>

# DirectoryIndex: sets the file that Apache will serve if a directory.
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

# The following lines prevent .htaccess.
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<Files ".ht*">
    Require all denied
</Files>

# <ErrorLog: The location of the
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# If you *do* define an error logfile for a <VirtualHost>. container, that host's error messages relating to that virtual host will be logged here;
# container, that host's errors will be logged there and not here.
#
ErrorLog "logs/error.log"

# LogLevel: Control the number of errors.
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
# LogLevel
LogLevel warn

<IfModule log_config_module>
    # The following directives define some format
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat 
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    # ScriptSock
    # Scriptsock logs/cgisock
</IfModule>

#
# "${SRVROOT}/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "${SRVROOT}/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    # AddType
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    # AddType application/x-gzip .tgz
    # AddEncoding
    # AddEncoding allows you to have certain browsers uncompress
    # Note: Not all browsers support this.
    #Note: Not all browsers support this.
    # AddEncoding x-compress .Z
    # AddEncoding x-gzip .gz .tgz
    #Z
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #.tgz
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    These can be either built into the server # or added with the Action directive (see below).
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    # AddHandler cgi-script .cgi .pl

    # For type maps (negotiated resources):
    #AddHandler type-map var

    # AddHandler type-map var
    # Filters allow you to process content before it is sent to the client.
    # To parse .shtml
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    # AddType text/html .shtml
    # AddOutputFilter INCLUDES .shtml
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.
# directive tells the module where the hint definitions are located.
The MIMEMagicFile # directive tells the module where the hint definitions are located.
# MIMEMagicFile conf/magic

#conf/magic
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
# # MIMEMagicFile conf/magic
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# MaxRanges: Maximum number of Ranges in a request before
# returning the entire resource, or one of the special
# values 'default', 'none' or 'unlimited'.
# Default setting is to accept 200 Ranges.
#MaxRanges unlimited

#MaxRanges unlimited.
# EnableMMAP and EnableSendfile: On systems that support it, 
# memory-mapping or the sendfile syscall may be used to deliver
# This usually improves server performance, but must
# be turned off when serving from networked-mounted 
# filesystems or if support for these functions is otherwise
This usually improves server performance, but must # be turned off when serving from networked-mounted # filesystems or if support for these functions is otherwise broken on your system.
# Defaults: EnableMMAP On, EnableSendfile Off
# EnableMMAP On, EnableSendfile Off
#EnableMMAP off
# EnableSendfile on

#AcceptFilter http none
#AcceptFilter https none

# Supplemental configuration
# Supplemental configuration
# The configuration files in the conf/extra/ directory can be 
# included to add extra features or to modify the default configuration of 
# the server, or you may simply c