Adding Modules
347
22.6. Adding Modules
The Apache HTTP Server is distributed with a number of modules. More information about Apache
HTTP modules can be found on
http://httpd.apache.org/docs/2.2/mod/
.
The Apache HTTP Server supports
Dynamically Shared Objects
(
DSO
s), or modules, which can
easily be loaded at runtime as necessary.
The Apache Project provides complete DSO documentation online at
http://httpd.apache.org/docs/2.2/
dso.html
. Or, if the
http-manual
package is installed, documentation about DSOs can be found
online at
http://localhost/manual/mod/
.
For the Apache HTTP Server to use a DSO, it must be specified in a
LoadModule
directive within
/etc/httpd/conf/httpd.conf
. If the module is provided by a separate package, the line must
appear within the modules configuration file in the
/etc/httpd/conf.d/
directory. Refer to
LoadModule
for more information.
If adding or deleting modules from
http.conf
, Apache HTTP Server must be reloaded or restarted,
as referred to in
Section 22.3, “Starting and Stopping
httpd
”
.
If creating a new module, first install the
httpd-devel
package which contains the include files,
the header files, as well as the
APache eXtenSion
(
/usr/sbin/apxs
) application, which uses the
include files and the header files to compile DSOs.
After writing a module, use
/usr/sbin/apxs
to compile the module sources outside the Apache
source tree. For more information about using the
/usr/sbin/apxs
command, refer to the the
Apache documentation online at
http://httpd.apache.org/docs/2.2/dso.html
as well as the
apxs
man
page.
Once compiled, put the module in the
/usr/lib/httpd/modules/
directory. For RHEL platforms
using default-64-bit userspace (x86_64, ia64, ?) this path will be
/usr/lib64/httpd/modules/
.
Then add a
LoadModule
line to the
httpd.conf
, using the following structure:
LoadModule
<module-name> <path/to/module.so>
Where
<module-name>
is the name of the module and
<path/to/module.so>
is the path to the
DSO.
22.7. Virtual Hosts
The Apache HTTP Server's built in virtual hosting allows the server to provide different information
based on which IP address, hostname, or port is being requested. A complete guide to using virtual
hosts is available online at
http://httpd.apache.org/docs/2.2/vhosts/
.
22.7.1. Setting Up Virtual Hosts
To create a name-based virtual host, it is best to use the virtual host container provided in
httpd.conf
as an example.
The virtual host example read as follows:
#NameVirtualHost *:80
#
#<VirtualHost *:80>
Содержание ENTERPRISE LINUX 5 - VIRTUAL SERVER ADMINISTRATION
Страница 22: ...xxii ...
Страница 28: ......
Страница 36: ...10 ...
Страница 40: ...14 ...
Страница 96: ...70 ...
Страница 116: ...90 ...
Страница 144: ...118 ...
Страница 146: ......
Страница 158: ...132 ...
Страница 165: ...Installing and Removing Packages 139 Figure 11 7 Installing and removing packages simultaneously ...
Страница 166: ...140 ...
Страница 172: ...146 ...
Страница 178: ......
Страница 228: ...202 ...
Страница 264: ...238 ...
Страница 318: ...292 ...
Страница 330: ...304 ...
Страница 388: ...362 ...
Страница 428: ...402 ...
Страница 452: ......
Страница 458: ...432 ...
Страница 476: ...450 ...
Страница 478: ...452 ...
Страница 494: ...468 ...
Страница 498: ...472 ...
Страница 530: ...504 ...
Страница 536: ...510 ...
Страница 544: ...Chapter 36 Log Files 518 Figure 36 7 Log file contents after five seconds ...
Страница 546: ......
Страница 550: ...524 ...
Страница 576: ......
Страница 584: ...558 ...
Страница 608: ......
Страница 776: ...750 ...
Страница 796: ...770 ...
Страница 800: ...774 ...
Страница 804: ......
Страница 806: ...780 ...
Страница 808: ...782 ...
Страница 816: ...790 ...
Страница 820: ...794 ...
Страница 822: ...796 ...
Страница 830: ...804 ...
Страница 836: ...810 ...
Страница 844: ...818 ...
Страница 848: ...822 ...