Apache命令——语法检查

简介:

Apache configuration files contain one directive per line. The backslash "\" may be used as the last character on a line to indicate that the directive continues onto the next line. There must be no other characters or white space between the backslash and the end of the line.

Directives in the configuration files are case-insensitive, but arguments to directives are often case sensitive. Lines that begin with the hash character "#" are considered comments, and are ignored. Comments may not be included on a line after a configuration directive. Blank lines and white space occurring before a directive are ignored, so you may indent directives for clarity.

You can check your configuration files for syntax errors without starting the server by using apachectl configtest or the -t command line option.

在Apache的配置文件中每一行包含一个指令反斜杠“\可能作为下一行的继续标志指令继续到下一行最后一个字符在行的结尾不能其他字符或空格在配置文件中指令是区分大小写的,但往往是大小写敏感的指令参数每行的开始散列符“#”作为注释此行中的所有内容将被忽略。注释不得计入命令行中的配置指令空行和空格前存在的指令被忽略,所以你可以缩进以标识指令

可以使用apachectl configtest 或 -t 命令行选项检查您的配置文件是否存在语法错误

如下面所示:

 
  1. [root@localhost ~]# vim /etc/httpd/conf/httpd.conf 
  2. [root@localhost ~]# service httpd restart 
  3. Stopping httpd:                                   [  OK  ] 
  4. Starting httpd:                                   [  OK  ] 
  5. [root@localhost ~]# apachectl configtest 
  6. Syntax OK 
  7. [root@localhost ~]# apachectl -
  8. Syntax OK
  9. [root@localhost ~]# httpd -t
  • Syntax OK
  • [root@localhost ~]#

 



本文转自 urey_pp 51CTO博客,原文链接:http://blog.51cto.com/dgd2010/820206,如需转载请自行联系原作者


相关文章
|
关系型数据库 MySQL Shell
Apache Doris常用命令
一.配置 Ⅰ).BE vi be.conf # INFO,WARNING,ERROR,FATAL sys_log_level=INFO # ports for admin,web,heartbeat service be_port=9060 be_rpc_port=9070 webserver_.
4126 0
|
11月前
|
Java 网络安全 Apache
SshClient应用指南:使用org.apache.sshd库在服务器中执行命令。
总结起来,Apache SSHD库是一个强大的工具,甚至可以用于创建你自己的SSH Server。当你需要在服务器中执行命令时,这无疑是非常有用的。希望这个指南能对你有所帮助,并祝你在使用Apache SSHD库中有一个愉快的旅程!
756 29
|
Shell Linux Apache
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
465 1
|
Shell Linux 网络安全
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
381 0
|
Ubuntu Linux Apache
Linux基础命令---htdigest建立和更新apache服务器摘要
htdigest htdigest指令用来建立和更新apache服务器用于摘要认证的存放用户认证信息的文件。 此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS。 1、语法 htdigest [-c] passfile realm username 2、...
1183 0
|
消息中间件 Java Kafka
Apache Kafka-初体验Kafka(02)-Centos7下搭建单节点kafka_配置参数详解_基本命令实操
Apache Kafka-初体验Kafka(02)-Centos7下搭建单节点kafka_配置参数详解_基本命令实操
412 0
|
缓存 Apache
执行命令安装Apache及其扩展包时报错
执行命令安装Apache及其扩展包时报错
343 1
|
消息中间件 Java Linux
Apache RocketMQ在linux上的常用命令
Apache RocketMQ在linux上的常用命令
493 12
|
存储 安全 Java
【Shiro】Apache Shiro 默认密钥致命令执行漏洞(CVE-2016-4437)的解决方案
【Shiro】Apache Shiro 默认密钥致命令执行漏洞(CVE-2016-4437)的解决方案
1742 0
|
运维 监控 网络协议
Apache ZooKeeper - FourLetterCommands运维命令
Apache ZooKeeper - FourLetterCommands运维命令
473 0

推荐镜像

更多