Apache Guide: Configuring Your Apache Server Installation Page 2

執筆者
Rich Bowen
Rich Bowen
Published: Jul 10, 2000
Updated: Nov 10, 2020
2 minute read
ServerWatch のコンテンツおよび製品のおすすめは、編集上の独立性を保っています。パートナーへのリンクをクリックすると、当社が報酬を得る場合があります。 詳細を見る



My personal preference is to install all of Apache in one location
(/usr/local/apache, to be specific) and then just make symlinks
from other locations. For example, system log files are located in
/var/log, so it might make sense to have the Apache log files
there also. However, instead of using a
--logfiledir=/var/log/httpd configuration option, I simply create
a symbolic link from /var/log/httpd to
/usr/local/apache/logs:

        cd /var/log
        ln -s /usr/local/apache/logs httpd

This is also handy for your log rotate scripts, which expect log files to
be in /var/log and subdirectories thereof.

Module Configuration

You can tell Apache what modules to build and activate with configuration
options. In a default configuration, some modules are enabled, and others are
not. To change this default configuration, you can use the
--enable-module and --disable-module directives.

The default configuration is as follows:

                        [access=yes      actions=yes     alias=yes      ]
                        [asis=yes        auth=yes        auth_anon=no   ]
                        [auth_db=no      auth_dbm=no     auth_digest=no ]
                        [autoindex=yes   cern_meta=no    cgi=yes        ]
                        [digest=no       dir=yes         env=yes        ]
                        [example=no      expires=no      headers=no     ]
                        [imap=yes        include=yes     info=no        ]
                        [log_agent=no    log_config=yes  log_referer=no ]
                        [mime=yes        mime_magic=no   mmap_static=no ]
                        [negotiation=yes proxy=no        rewrite=no     ]
                        [setenvif=yes    so=no           speling=no     ]
                        [status=yes      unique_id=no    userdir=yes    ]
                        [usertrack=no    vhost_alias=no                 ]

For example:

        ./configure --prefix=/home/httpd --enable-module=speling                         --disable-module=userdir

If you wish to build a particular module as a shared object you can use the
--enable-shared option. For example:

        ./configure --prefix=/usr/local/apache                 --enable-module=rewrite                 --enable-shared=rewrite

To compile and enable a module that is not part of the standard Apache
distribution, you can use the --add-module and
--activate-module options. For example:

        ./configure --prefix=/usr/local/apache                 --add-module=/home/rbowen/mods/mod_mine.c

Manually Tweaking Your Configuration

As I mentioned in my last column, there are two ways to configure your
Apache build. There's the method describe above, and then there's the
"old-fashioned" manual process. In the src/ subdirectory
is a script called Configure (big C), which uses a file called
Configuration to configure your build. A sample
Configuration file, called Configuation.tmpl, comes
with Apache. And when you run configure (small c), a configuration
file called Configuration.apaci is generated, and is then used by
Configure (big C) to configure the build.

Rich Bowen

Rich Bowen is a ServerWatch contributor.

ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

TechnologyAdvice が所有・運営しています。 © 2026 TechnologyAdvice. 無断転載を禁じます

広告主に関する開示:このサイトに掲載されている製品の一部は、TechnologyAdvice が報酬を受け取っている企業のものです。この報酬は、製品がこのサイトのどこにどのように表示されるか(表示される順序など)に影響する場合があります。TechnologyAdvice は、市場で入手可能なすべての企業やすべての種類の製品を掲載しているわけではありません。