# Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so + LoadModule mpm_prefork_module modules/mod_mpm_prefork.so + LoadModule php7_module /usr/lib64/httpd/modules/libphp7.so
如果没有导入第一个mpm的话,应该会报如下错误:
1 2 3 4
Apr 27 15:25:56 iZe4h75o51zvd0Z httpd[255035]: AH00013: Pre-configuration failed Apr 27 15:25:56 iZe4h75o51zvd0Z systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE Apr 27 15:25:56 iZe4h75o51zvd0Z systemd[1]: httpd.service: Failed with result 'exit-code'. Apr 27 15:25:56 iZe4h75o51zvd0Z systemd[1]: Failed to start The Apache HTTP Server.
导入了这个之后还会报另一个错误:
1 2 3 4
Apr 27 15:28:49 iZe4h75o51zvd0Z httpd[256073]: AH00534: httpd: Configuration error: More than one MPM loaded. Apr 27 15:28:49 iZe4h75o51zvd0Z systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE Apr 27 15:28:49 iZe4h75o51zvd0Z systemd[1]: httpd.service: Failed with result 'exit-code'. Apr 27 15:28:49 iZe4h75o51zvd0Z systemd[1]: Failed to start The Apache HTTP Server.
# event MPM: A variant of the worker MPM with the goal of consuming # threads only for connections with active processing # See: http://httpd.apache.org/docs/2.4/mod/event.html # + #LoadModule mpm_event_module modules/mod_mpm_event.so - LoadModule mpm_event_module modules/mod_mpm_event.so
# 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
+ AddType application/x-httpd-php .php
让index.php可读
找到DirectoryIndex,在后面加上index.php:
1 2 3 4 5 6 7 8
# # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module> - DirectoryIndex index.html index.htm + DirectoryIndex index.html index.htm index.php </IfModule>