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,如需转载请自行联系原作者


相关文章
|
22小时前
|
Shell Linux 网络安全
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
36 0
|
22小时前
|
Shell Linux Apache
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
168 1
|
7月前
|
存储 安全 Java
【Shiro】Apache Shiro 默认密钥致命令执行漏洞(CVE-2016-4437)的解决方案
【Shiro】Apache Shiro 默认密钥致命令执行漏洞(CVE-2016-4437)的解决方案
161 0
|
10月前
|
缓存 Apache
执行命令安装Apache及其扩展包时报错
执行命令安装Apache及其扩展包时报错
197 1
|
12月前
|
Java Apache 容器
Apache ZooKeeper - 节点实操常用zookeeper命令
Apache ZooKeeper - 节点实操常用zookeeper命令
88 0
|
Ubuntu Linux Apache
Linux基础命令---htdigest建立和更新apache服务器摘要
htdigest htdigest指令用来建立和更新apache服务器用于摘要认证的存放用户认证信息的文件。 此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS。 1、语法 htdigest [-c] passfile realm username 2、...
1047 0
|
SQL 分布式计算 Hadoop
Apache Hive--DDL--修改表&显示命令| 学习笔记
快速学习 Apache Hive--DDL--修改表&显示命令
Apache Hive--DDL--修改表&显示命令| 学习笔记
|
XML 安全 Java
网站apache环境S2-057漏洞 利用POC 远程执行命令漏洞复现
S2-057漏洞,于2018年8月22日被曝出,该Struts2 057漏洞存在远程执行系统的命令,尤其使用linux系统,apache环境,影响范围较大,危害性较高,如果被攻击者利用直接提权到服务器管理员权限,网站数据被篡改,数据库被盗取都会发生。
129 0
网站apache环境S2-057漏洞 利用POC 远程执行命令漏洞复现
|
安全 前端开发 Java
检查你的项目有没有Apache Log4j2 RCE漏洞
12 月 10 日凌晨,Apache 开源项目 Log4j 的远程代码执行漏洞细节被公开,Apache Log4j 2.x <= 2.14.1 版本均回会受到影响。
检查你的项目有没有Apache Log4j2 RCE漏洞

热门文章

最新文章

推荐镜像

更多