Latest web development tutorials

Linux httpd命令

Linux 命令大全 Linux命令大全

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

httpd為Apache HTTP服務器程序。 直接執行程序可啟動服務器的服務。

語法

httpd [-hlLStvVX][-c<httpd指令>][-C<httpd指令>][-d<服务器根目录>][-D<设定文件参数>][-f<设定文件>]

參數說明 :

  • -c<httpd指令> 在讀取配置文件前,先執行選項中的指令。
  • -C<httpd指令> 在讀取配置文件後,再執行選項中的指令。
  • -d<服務器根目錄> 指定服務器的根目錄。
  • -D<設定文件參數> 指定要傳入配置文件的參數。
  • -f<設定文件> 指定配置文件。
  • -h 顯示幫助。
  • -l 顯示服務器編譯時所包含的模塊。
  • -L 顯示httpd指令的說明。
  • -S 顯示配置文件中的設定。
  • -t 測試配置文件的語法是否正確。
  • -v 顯示版本信息。
  • -V 顯示版本信息以及建立環境。
  • -X 以單一程序的方式來啟動服務器。

實例

檢查配置文件語法錯誤

# httpd -t
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Syntax OK

啟動httpd

httpd
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

顯示編譯模塊

# httpd -l 
Compiled in modules:
 core.c
 prefork.c
 http_core.c
 mod_so.c

顯示配置文件

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

Linux 命令大全 Linux命令大全