【问题标题】:httpd: Syntax error on line 1011 of /etc/httpd/conf/httpd.conf: GracefulShutDownTimeout> directive missing closing '>'httpd:/etc/httpd/conf/httpd.conf 第 1011 行的语法错误:GracefulShutDownTimeout> 指令缺少关闭“>”
【发布时间】:2015-08-21 06:50:39
【问题描述】:

我是网络托管新手,我正在创建虚拟主机,我想在我的 VPS(没有 cpanel 的 Hostgator)上创建新站点。我按照指示编辑了 httpd.conf 文件,我的编辑如下..

以前

#NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier 
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>GracefulShutDownTimeout 3
AddOutputFilter INCLUDES .shtml
AddType text/html .shtml
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
GracefulShutDownTimeout 3

我的编辑..

NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier 
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *:80>
    ServerAdmin webmaster@glinks.ga
    DocumentRoot /var/www/glinks.ga/public_html
    ServerName www.glilnks.ga
    ErrorLog/var/www/glinks.ga/error.log
    CustomLog /var/www/glinks.ga/requests.log
</VirtualHost>GracefulShutDownTimeout 3
AddOutputFilter INCLUDES .shtml
AddType text/html .shtml
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
GracefulShutDownTimeout 3

但我遇到了错误

    New files of configuration for Apache web server
     were not built due to errors in configuration templates: 
    httpd: Syntax error on line 1011 
of /etc/httpd/conf/httpd.conf: GracefulShutDownTimeout> directive missing closing '>' .

我该如何解决..

【问题讨论】:

  • 第 1011 行是什么?是否与额外的 GracefulShutDownTimeout (&lt;/VirtualHost&gt;GracefulShutDownTimeout 3) 一致?

标签: apache localhost hosting web-hosting


【解决方案1】:

问题来自&lt;/VirtualHost&gt;GracefulShutDownTimeout 3这一行:在两个指令之间添加一行return:

</VirtualHost>
GracefulShutDownTimeout 3

您还应该修复虚拟主机中的日志指令(ErrorLog 缺少空格,CustomLog 缺少格式):

ErrorLog /var/www/glinks.ga/error.log
CustomLog /var/www/glinks.ga/requests.log common

【讨论】:

    猜你喜欢
    • 2015-07-02
    • 2018-04-19
    • 2014-02-15
    • 2017-06-20
    • 2014-05-04
    • 2016-06-22
    • 2018-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多