簡體   English   中英

Centos 上的 Apache

[英]Apache on Centos

我正在嘗試根據本教程CentOS 8設置 Apache 。

在教程結束時,我無法重新啟動 httpd。 我收到此錯誤:

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]$

我能做些什么來強制它啟動?

您不能強制 Apache 啟動,出現該錯誤; 發布你的.conf文件,也許你有錯誤

你是說這個文件嗎? /etc/httpd/sites-enabled/domain.net.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

一封信出錯:) Document Root 而不是 Document Root

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM