httpd:/etc/httpd/conf/httpd.conf的第1011行的语法错误:GracefulShutDownTimeout>指令缺少关闭'>'

时间:2015-06-06 09:59:57

标签: apache localhost hosting web-hosting

我是网络托管新手,我正在创建虚拟主机,我想在我的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 '>' .

我如何解决..

1 个答案:

答案 0 :(得分:0)

问题来自第42 42 123 123 行:在两个指令之间添加一行回复:

#define VAR_NAME a_variable
...
#define DECL_VAR int VAR_NAME

// Declare an int named a_variable
DECL_VAR;

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

</VirtualHost>GracefulShutDownTimeout 3