免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6384 | 回复: 0
打印 上一主题 下一主题

[服务应用] 请问一个安装apache时候出现的错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-10-20 18:13 |只看该作者 |倒序浏览
我安装的是apache的这个版本 httpd-2.4.10,是通过编译安装的,参数为
./configure --prefix=/usr/local/apache  \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util  \
--enable-so \
--enable-rewrite \
--enable-ssl \
--enable-cgi \
--enable-cgid \
--enable-modules=most \
--enable-mods-shared=most \
--enable-mpms-shared=all

make,make install的时候,并没有出错

但是安装完成之后,启动http,出现如下错误
./apachectl start
AH00534: httpd: Configuration error: No MPM loaded.

他说,没有mpm被载入,我查看了一下配置文件httpd.conf,确实没有Load语句载入
  1. [root@LinuxServer conf]# more httpd.conf
  2. #
  3. # This is the main Apache HTTP server configuration file.  It contains the
  4. # configuration directives that give the server its instructions.
  5. # See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
  6. # In particular, see
  7. # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
  8. # for a discussion of each configuration directive.
  9. #
  10. # Do NOT simply read the instructions in here without understanding
  11. # what they do.  They're here only as hints or reminders.  If you are unsure
  12. # consult the online docs. You have been warned.  
  13. #
  14. # Configuration and logfile names: If the filenames you specify for many
  15. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  16. # server will use that explicit path.  If the filenames do *not* begin
  17. # with "/", the value of ServerRoot is prepended -- so 'log/access_log'
  18. # with ServerRoot set to '/www' will be interpreted by the
  19. # server as '/www/log/access_log', where as '/log/access_log' will be
  20. # interpreted as '/log/access_log'.

  21. #
  22. # ServerRoot: The top of the directory tree under which the server's
  23. # configuration, error, and log files are kept.
  24. #
  25. # Do not add a slash at the end of the directory path.  If you point
  26. # ServerRoot at a non-local disk, be sure to point the LockFile directive
  27. # at a local disk.  If you wish to share the same ServerRoot for multiple
  28. # httpd daemons, you will need to change at least LockFile and PidFile.
  29. #
  30. ServerRoot "/usr/local/apache"

  31. #
  32. # Listen: Allows you to bind Apache to specific IP addresses and/or
  33. # ports, instead of the default. See also the <VirtualHost>
  34. # directive.
  35. #
  36. # Change this to Listen on specific IP addresses as shown below to
  37. # prevent Apache from glomming onto all bound IP addresses.
  38. #
  39. #Listen 12.34.56.78:80
  40. Listen 80

  41. #
  42. # Dynamic Shared Object (DSO) Support
  43. #
  44. # To be able to use the functionality of a module which was built as a DSO you
  45. # have to place corresponding `LoadModule' lines at this location so the
  46. # directives contained in it are actually available _before_ they are used.
  47. # Statically compiled modules (those listed by `httpd -l') do not need
  48. # to be loaded here.
  49. #
  50. # Example:
  51. # LoadModule foo_module modules/mod_foo.so
  52. #
  53. LoadModule mpm_event_module modules/mod_mpm_event.so
  54. LoadModule authz_host_module modules/mod_authz_host.so

  55. <IfModule !mpm_netware_module>
  56. <IfModule !mpm_winnt_module>
  57. #
  58. # If you wish httpd to run as a different user or group, you must run
  59. # httpd as root initially and it will switch.  
  60. #
  61. # User/Group: The name (or #number) of the user/group to run httpd as.
  62. # It is usually good practice to create a dedicated user and group for
  63. # running httpd, as with most system services.
  64. #
  65. User apache
  66. Group apache

  67. </IfModule>
  68. </IfModule>

  69. # 'Main' server configuration
  70. #
  71. # The directives in this section set up the values used by the 'main'
  72. # server, which responds to any requests that aren't handled by a
  73. # <VirtualHost> definition.  These values also provide defaults for
  74. # any <VirtualHost> containers you may define later in the file.
  75. #
  76. # All of these directives may appear inside <VirtualHost> containers,
  77. # in which case these default settings will be overridden for the
  78. # virtual host being defined.
  79. #

  80. #
  81. # ServerAdmin: Your address, where problems with the server should be
  82. # e-mailed.  This address appears on some server-generated pages, such
  83. # as error documents.  e.g. admin@your-domain.com
  84. #
  85. #ServerAdmin you@127.0.0.1.

  86. #
  87. # ServerName gives the name and port that the server uses to identify itself.
  88. # This can often be determined automatically, but we recommend you specify
  89. # it explicitly to prevent problems during startup.
  90. #
  91. # If your host doesn't have a registered DNS name, enter its IP address here.
  92. #
  93. #ServerName www.example.com:80

  94. #
  95. # DocumentRoot: The directory out of which you will serve your
  96. # documents. By default, all requests are taken from this directory, but
  97. # symbolic links and aliases may be used to point to other locations.
  98. #
  99. DocumentRoot "/usr/local/apache/htdocs"

  100. #
  101. # Each directory to which Apache has access can be configured with respect
  102. # to which services and features are allowed and/or disabled in that
  103. # directory (and its subdirectories).
  104. #
  105. # First, we configure the "default" to be a very restrictive set of
  106. # features.  
  107. #
  108. <Directory />
  109.     Options FollowSymLinks
  110.     AllowOverride None
  111.     Order deny,allow
  112.     Deny from all
  113. </Directory>

  114. #
  115. # Note that from this point forward you must specifically allow
  116. # particular features to be enabled - so if something's not working as
  117. # you might expect, make sure that you have specifically enabled it
  118. # below.
  119. #

  120. #/
  121. # This should be changed to whatever you set DocumentRoot to.
  122. #
  123. <Directory "/usr/local/apache/htdocs">
  124.     #
  125.     # Possible values for the Options directive are "None", "All",
  126.     # or any combination of:
  127.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  128.     #
  129.     # Note that "MultiViews" must be named *explicitly* --- "Options All"
  130.     # doesn't give it to you.
  131.     #
  132.     # The Options directive is both complicated and important.  Please see
  133.     # http://httpd.apache.org/docs/2.2/mod/core.html#options
  134.     # for more information.
  135.     #
  136.     Options Indexes FollowSymLinks

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

  143.     #
  144.     # Controls who can get stuff from this server.
  145.     #
  146.     Order allow,deny
  147.     Allow from all

  148. </Directory>

  149. #
  150. # DirectoryIndex: sets the file that Apache will serve if a directory
  151. # is requested.
  152. #
  153. <IfModule dir_module>
  154.     DirectoryIndex index.html
  155. </IfModule>

  156. #
  157. # The following lines prevent .htaccess and .htpasswd files from being
  158. # viewed by Web clients.
  159. #
  160. <FilesMatch "^\.ht">
  161.     Order allow,deny
  162.     Deny from all
  163.     Satisfy All
  164. </FilesMatch>

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

  173. #
  174. # LogLevel: Control the number of messages logged to the error_log.
  175. # Possible values include: debug, info, notice, warn, error, crit,
  176. # alert, emerg.
  177. #
  178. LogLevel info

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

  186.     <IfModule logio_module>
  187.       # You need to enable mod_logio.c to use %I and %O
  188.       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  189.     </IfModule>

  190.     #
  191.     # The location and format of the access logfile (Common Logfile Format).
  192.     # If you do not define any access logfiles within a <VirtualHost>
  193.     # container, they will be logged here.  Contrariwise, if you *do*
  194.     # define per-<VirtualHost> access logfiles, transactions will be
  195.     # logged therein and *not* in this file.
  196.     #
  197.     CustomLog "logs/access_log" common

  198.     #
  199.     # If you prefer a logfile with access, agent, and referer information
  200.     # (Combined Logfile Format) you can use the following directive.
  201.     #
  202.     #CustomLog "logs/access_log" combined
  203. </IfModule>

  204. <IfModule alias_module>
  205.     #
  206.     # Redirect: Allows you to tell clients about documents that used to
  207.     # exist in your server's namespace, but do not anymore. The client
  208.     # will make a new request for the document at its new location.
  209.     # Example:
  210.     # Redirect permanent /foo http://www.example.com/bar

  211.     #
  212.     # Alias: Maps web paths into filesystem paths and is used to
  213.     # access content that does not live under the DocumentRoot.
  214.     # Example:
  215.     # Alias /webpath /full/filesystem/path
  216.     #
  217.     # If you include a trailing / on /webpath then the server will
  218.     # require it to be present in the URL.  You will also likely
  219.     # need to provide a <Directory> section to allow access to
  220.     # the filesystem path.

  221.     #
  222.     # ScriptAlias: This controls which directories contain server scripts.
  223.     # ScriptAliases are essentially the same as Aliases, except that
  224.     # documents in the target directory are treated as applications and
  225.     # run by the server when requested rather than as documents sent to the
  226.     # client.  The same rules about trailing "/" apply to ScriptAlias
  227.     # directives as to Alias.
  228.     #
  229.     ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

  230. </IfModule>

  231. <IfModule cgid_module>
  232.     #
  233.     # ScriptSock: On threaded servers, designate the path to the UNIX
  234.     # socket used to communicate with the CGI daemon of mod_cgid.
  235.     #
  236.     #Scriptsock logs/cgisock
  237. </IfModule>

  238. #
  239. # "/usr/local/apache/cgi-bin" should be changed to whatever your ScriptAliased
  240. # CGI directory exists, if you have that configured.
  241. #
  242. <Directory "/usr/local/apache/cgi-bin">
  243.     AllowOverride None
  244.     Options None
  245.     Order allow,deny
  246.     Allow from all
  247. </Directory>

  248. #
  249. # DefaultType: the default MIME type the server will use for a document
  250. # if it cannot otherwise determine one, such as from filename extensions.
  251. # If your server contains mostly text or HTML documents, "text/plain" is
  252. # a good value.  If most of your content is binary, such as applications
  253. # or images, you may want to use "application/octet-stream" instead to
  254. # keep browsers from trying to display binary files as though they are
  255. # text.
  256. #
  257. DefaultType text/plain

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

  264.     #
  265.     # AddType allows you to add to or override the MIME configuration
  266.     # file specified in TypesConfig for specific file types.
  267.     #
  268.     #AddType application/x-gzip .tgz
  269.     #
  270.     # AddEncoding allows you to have certain browsers uncompress
  271.     # information on the fly. Note: Not all browsers support this.
  272.     #
  273.     #AddEncoding x-compress .Z
  274.     #AddEncoding x-gzip .gz .tgz
  275.     #
  276.     # If the AddEncoding directives above are commented-out, then you
  277.     # probably should define those extensions to indicate media types:
  278.     #
  279.     AddType application/x-compress .Z
  280.     AddType application/x-gzip .gz .tgz

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

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

  292.     #
  293.     # Filters allow you to process content before it is sent to the client.
  294.     #
  295.     # To parse .shtml files for server-side includes (SSI):
  296.     # (You will also need to add "Includes" to the "Options" directive.)
  297.     #
  298.     #AddType text/html .shtml
  299.     #AddOutputFilter INCLUDES .shtml
  300. </IfModule>

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

  307. #
  308. # Customizable error responses come in three flavors:
  309. # 1) plain text 2) local redirects 3) external redirects
  310. #
  311. # Some examples:
  312. #ErrorDocument 500 "The server made a boo boo."
  313. #ErrorDocument 404 /missing.html
  314. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  315. #ErrorDocument 402 http://www.example.com/subscription_info.html
  316. #

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

  323. #
  324. # EnableMMAP and EnableSendfile: On systems that support it,
  325. # memory-mapping or the sendfile syscall is used to deliver
  326. # files.  This usually improves server performance, but must
  327. # be turned off when serving from networked-mounted
  328. # filesystems or if support for these functions is otherwise
  329. # broken on your system.
  330. #
  331. #EnableMMAP off
  332. #EnableSendfile off

  333. # Supplemental configuration
  334. #
  335. # The configuration files in the conf/extra/ directory can be
  336. # included to add extra features or to modify the default configuration of
  337. # the server, or you may simply copy their contents here and change as
  338. # necessary.

  339. # Server-pool management (MPM specific)
  340. #Include conf/extra/httpd-mpm.conf

  341. # Multi-language error messages
  342. #Include conf/extra/httpd-multilang-errordoc.conf

  343. # Fancy directory listings
  344. #Include conf/extra/httpd-autoindex.conf

  345. # Language settings
  346. #Include conf/extra/httpd-languages.conf

  347. # User home directories
  348. #Include conf/extra/httpd-userdir.conf

  349. # Real-time info on requests and configuration
  350. #Include conf/extra/httpd-info.conf

  351. # Virtual hosts
  352. Include conf/extra/httpd-vhosts.conf

  353. # Local access to the Apache HTTP Server Manual
  354. #Include conf/extra/httpd-manual.conf

  355. # Distributed authoring and versioning (WebDAV)
  356. #Include conf/extra/httpd-dav.conf

  357. # Various default settings
  358. #Include conf/extra/httpd-default.conf

  359. # Secure (SSL/TLS) connections
  360. #Include conf/extra/httpd-ssl.conf
  361. #
  362. # Note: The following must must be present to support
  363. #       starting without SSL on platforms with no /dev/random equivalent
  364. #       but a statically compiled-in mod_ssl.
  365. #
  366. <IfModule ssl_module>
  367. SSLRandomSeed startup builtin
  368. SSLRandomSeed connect builtin
  369. </IfModule>
复制代码
但是当我载入之后,却又报错了
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

启动之后,报错
  1. root@LinuxServer bin]# ./apachectl start
  2. AH00526: Syntax error on line 67 of /usr/local/apache/conf/httpd.conf:
  3. Invalid command 'User', perhaps misspelled or defined by a module not included in the server configuration
复制代码
十分崩溃呀,还请大师帮忙解惑。駎駎
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP