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