• 要找福利?记不住网址?搜不到?如何与我们保持联系?试试 CTRL+D 把零点博客添加进您的浏览器收藏夹,一键直达永不失联!

网络通讯Linux httpd命令

linux系统 涛涛 91次浏览 0个评论

Linux httpd命令是Apache HTTP服务器程序。

httpd为Apache HTTP服务器程序。直接执行程序可启动服务器的服务。

语法

<span class="pln">httpd </span><span class="pun">[-</span><span class="pln">hlLStvVX</span><span class="pun">][-</span><span class="pln">c</span><span class="pun"><</span><span class="pln">httpd</span><span class="pun">指令>][-</span><span class="pln">C</span><span class="pun"><</span><span class="pln">httpd</span><span class="pun">指令>][-</span><span class="pln">d</span><span class="pun"><服务器根目录>][-</span><span class="pln">D</span><span class="pun"><设定文件参数>][-</span><span class="pln">f</span><span class="pun"><设定文件>]</span>

参数说明

  • -c<httpd指令> 在读取配置文件前,先执行选项中的指令。
  • -C<httpd指令> 在读取配置文件后,再执行选项中的指令。
  • -d<服务器根目录> 指定服务器的根目录。
  • -D<设定文件参数> 指定要传入配置文件的参数。
  • -f<设定文件> 指定配置文件。
  • -h 显示帮助。
  • -l 显示服务器编译时所包含的模块。
  • -L 显示httpd指令的说明。
  • -S 显示配置文件中的设定。
  • -t 测试配置文件的语法是否正确。
  • -v 显示版本信息。
  • -V 显示版本信息以及建立环境。
  • -X 以单一程序的方式来启动服务器。

实例

检查配置文件语法错误

<span class="com"># httpd -t</span><span class="pln">
httpd</span><span class="pun">:</span> <span class="typ">Could</span> <span class="kwd">not</span><span class="pln"> determine the server</span><span class="str">'s fully qualified domain name, using 127.0.0.1 for ServerName
Syntax OK</span>

启动httpd

<span class="pln">httpd
httpd</span><span class="pun">:</span> <span class="typ">Could</span> <span class="kwd">not</span><span class="pln"> determine the server</span><span class="str">'s fully qualified domain name, using 127.0.0.1 for ServerName</span>

显示编译模块

<span class="com"># httpd -l </span>
<span class="typ">Compiled</span> <span class="kwd">in</span><span class="pln"> modules</span><span class="pun">:</span><span class="pln">
 core</span><span class="pun">.</span><span class="pln">c
 prefork</span><span class="pun">.</span><span class="pln">c
 http_core</span><span class="pun">.</span><span class="pln">c
 mod_so</span><span class="pun">.</span><span class="pln">c</span>

显示配置文件

<span class="com"># httpd -L>1.log|tail -n 20 1.log</span>
<span class="typ">Maximum</span><span class="pln"> number of children alive at the same time
</span><span class="typ">Allowed</span> <span class="kwd">in</span> <span class="pun">*.</span><span class="pln">conf only outside </span><span class="pun">,</span> <span class="kwd">or</span> 
<span class="typ">ServerLimit</span> <span class="pun">(</span><span class="pln">prefork</span><span class="pun">.</span><span class="pln">c</span><span class="pun">)</span>
<span class="typ">Maximum</span><span class="pln"> value of </span><span class="typ">MaxClients</span> <span class="kwd">for</span> <span class="kwd">this</span><span class="pln"> run of </span><span class="typ">Apache</span>
<span class="typ">Allowed</span> <span class="kwd">in</span> <span class="pun">*.</span><span class="pln">conf only outside </span><span class="pun">,</span> <span class="kwd">or</span> 
<span class="typ">KeepAliveTimeout</span> <span class="pun">(</span><span class="pln">http_core</span><span class="pun">.</span><span class="pln">c</span><span class="pun">)</span>
<span class="typ">Keep</span><span class="pun">-</span><span class="typ">Alive</span><span class="pln"> timeout duration </span><span class="pun">(</span><span class="pln">sec</span><span class="pun">)</span>
<span class="typ">Allowed</span> <span class="kwd">in</span> <span class="pun">*.</span><span class="pln">conf only outside </span><span class="pun">,</span> <span class="kwd">or</span> 
<span class="typ">MaxKeepAliveRequests</span> <span class="pun">(</span><span class="pln">http_core</span><span class="pun">.</span><span class="pln">c</span><span class="pun">)</span>
<span class="typ">Maximum</span><span class="pln"> number of </span><span class="typ">Keep</span><span class="pun">-</span><span class="typ">Alive</span><span class="pln"> requests per connection</span><span class="pun">,</span> <span class="kwd">or</span> <span class="lit">0</span> <span class="kwd">for</span><span class="pln"> infinite
</span><span class="typ">Allowed</span> <span class="kwd">in</span> <span class="pun">*.</span><span class="pln">conf only outside </span><span class="pun">,</span> <span class="kwd">or</span> 
<span class="typ">KeepAlive</span> <span class="pun">(</span><span class="pln">http_core</span><span class="pun">.</span><span class="pln">c</span><span class="pun">)</span>
<span class="typ">Whether</span><span class="pln"> persistent connections should be </span><span class="typ">On</span> <span class="kwd">or</span> <span class="typ">Off</span>
<span class="typ">Allowed</span> <span class="kwd">in</span> <span class="pun">*.</span><span class="pln">conf only outside </span><span class="pun">,</span> <span class="kwd">or</span> 
<span class="typ">LoadModule</span> <span class="pun">(</span><span class="pln">mod_so</span><span class="pun">.</span><span class="pln">c</span><span class="pun">)</span><span class="pln">
a </span><span class="kwd">module</span><span class="pln"> name </span><span class="kwd">and</span><span class="pln"> the name of a shared </span><span class="kwd">object</span><span class="pln"> file to load it </span><span class="kwd">from</span>
<span class="typ">Allowed</span> <span class="kwd">in</span> <span class="pun">*.</span><span class="pln">conf only outside </span><span class="pun">,</span> <span class="kwd">or</span> 
<span class="typ">LoadFile</span> <span class="pun">(</span><span class="pln">mod_so</span><span class="pun">.</span><span class="pln">c</span><span class="pun">)</span><span class="pln">
shared </span><span class="kwd">object</span><span class="pln"> file </span><span class="kwd">or</span><span class="pln"> library to load </span><span class="kwd">into</span><span class="pln"> the server at runtime
</span><span class="typ">Allowed</span> <span class="kwd">in</span> <span class="pun">*.</span><span class="pln">conf only outside </span><span class="pun">,</span> <span class="kwd">or</span>

欢迎转载本文:网络通讯Linux httpd命令
喜欢 (0)
[ld]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址