简体   繁体   English

Centos 上的 Apache

[英]Apache on Centos

I'm trying to setup an Apache according with this tutorial for CentOS 8 .我正在尝试根据本教程CentOS 8设置 Apache 。

By the end of the tutorial, I cannot restart httpd.在教程结束时,我无法重新启动 httpd。 I get this error:我收到此错误:

httpd.service - The Apache HTTP Server
    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Fri 2021-03-12 16:46:21 CET; 8min ago
      Docs: man:httpd(8)
            man:apachectl(8)
   Process: 8469 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
  Main PID: 8469 (code=exited, status=1/FAILURE)

Mar 12 16:46:21 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Mar 12 16:46:21 localhost.localdomain httpd[8469]: AH00526: Syntax error on line 4 of /etc/httpd/sites-enabled/<>.net.conf:
Mar 12 16:46:21 localhost.localdomain httpd[8469]: Invalid command 'DecumentRoot', perhaps misspelled or defined by a module not included in the server configuration
Mar 12 16:46:21 localhost.localdomain system[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 12 16:46:21 localhost.localdomain system[1]: Failed to start The Apache HTTP Server.
Mar 12 16:46:21 localhost.localdomain system[1]: Unit httpd.service entered failed state.
Mar 12 16:46:21 localhost.localdomain system[1]: httpd.service failed.
[tmaciocha@localhost sites-enabled]$

What can I do to force it to start?我能做些什么来强制它启动?

You cannot force Apache to start, with that error;您不能强制 Apache 启动,出现该错误; post your .conf file, maybe you have errors there发布你的.conf文件,也许你有错误

Do you mean this file?你是说这个文件吗? /etc/httpd/sites-enabled/domain.net.conf /etc/httpd/sites-enabled/domain.net.conf

enter image description here在此处输入图像描述

httpd.conf httpd.conf

    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi

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

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # 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>

#
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default.  To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
AddDefaultCharset UTF-8

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

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# 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
#

#
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall may be used to deliver
# files.  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 if commented: EnableMMAP On, EnableSendfile Off
#
#EnableMMAP off
EnableSendfile on

# Supplemental configuration
#
# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf
IncludeOptional sites-enabled/*.conf

There was error with a letter:) Document Root instead of Document Root一封信出错:) Document Root 而不是 Document Root

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM