在 Windows 中使用自訂 httpd.conf 檔案建立 Apache 服務

在 Windows 中使用自訂 httpd.conf 檔案建立 Apache 服務

我有我的custom-httpd.conf文件c:\apache\conf我想知道如何使用這個custom-httpd.conf文件而不是httpd.conf文件在 Windows 中創建 Apache 服務。

嘗試了以下命令但沒有成功

httpd.exe -k start -k config ..\conf\custom-httpd.conf -n "Apachefacade"

答案1

您應該能夠簡單地更改預設配置以指向您的自訂配置:

http://httpd.apache.org/docs/2.2/mod/core.html#include

如果您嘗試啟動第二個實例,則需要-f指定配置,在您使用的範例中-k

答案2

如果您傳遞這樣的命令來建立第二個服務:

httpd.exe -f conf/2.conf -k install -n server2

然後,每當您啟動名為「server2」的服務時,它將以 -f 指定的備用配置啟動。

相關內容