httpd
httpd是apache超文本傳輸協定的主程式,它被設計成一個獨立運作的守護程序。httpd會建立一個線程池來處理http請求。
此指令的适用範圍:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。
1、文法
httpd [選項]
2、參數清單
-d serverroot
設定伺服器根目錄。對應配置檔案中的ServerRoot指令
-f config
指定apache伺服器的配置檔案。如果配置檔案不使用絕對路徑,那麼就是相對于ServerRoot的路徑
-k start|restart|graceful|stop|graceful-stop
向httpd程序發送資訊,可以控制httpd
-C
在讀取配置檔案之前,先處理指定的指令
-c
在讀取配置檔案之後,處理指定的指令
-D param
設定參數,它可以配合apache的配置檔案中<IfDefine>一起使用
-e level
設定日志等級
-E file
設定錯誤資訊檔案
-h
顯示簡短的說明選項
-l
顯示靜态編譯的httpd子產品清單
-L
顯示apache服務配置檔案中的指令清單
-M
顯示httpd子產品清單
-S
顯示虛拟主機配置
-t
檢查配置檔案文法
-v
顯示httpd版本
-V
顯示編譯時的配置參數和版本資訊
-X
運作調試模式
3、執行個體
1)重新開機httpd服務
[root@localhost ~]# httpd -k restart //重新開機服務
You have new mail in /var/spool/mail/root
[root@localhost ~]#
2)檢測配置檔案
[root@localhost ~]# httpd –t //檢測配置檔案,沒有錯誤
httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
Syntax OK
[root@localhost ~]#
3)顯示apache中的子產品
[root@localhost ~]# httpd -M
httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
Loaded Modules:
core_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
auth_basic_module (shared)
auth_digest_module (shared)
authn_file_module (shared)
authn_alias_module (shared)
authn_anon_module (shared)
authn_dbm_module (shared)