Linux httpd命令
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