apache - Centos 上的 Apache
问题描述
我正在尝试根据本教程为CentOS 8
.
在教程结束时,我无法重新启动 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]$
我能做些什么来强制它启动?
解决方案
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
推荐阅读
- c++ - 将 boost-spirit 语法解析到结构中嵌入到另一个语法中会产生编译错误
- django - 如何根据 Django 中安装的语言在标题中动态生成链接标签?
- postgresql - 如何将 Postgres 中的文本数组映射到 Scala Slick
- python - python os.getcwd() 意外
- javascript - Ember 组件的动态模板参数
- c++ - 带智能指针的段错误
- javascript - 有没有办法只提取数组上的属性?
- vscode-settings - VSCode:隐藏包含括号的文件夹
- http - 在 Rust 中发送 HTTP 请求时如何使用 IF_INET6 - IPV6
- javascript - 当数据库为“.length”为空时如何显示“0”事件