如何更改默认的apache httpd.conf文件位置

时间:2016-07-18 14:13:54

标签: windows apache httpd.conf

apache httpd配置文件的默认位置httpd.conf是apache-http-root \ conf文件夹。如何更改此位置以从其他位置加载配置文件?

1 个答案:

答案 0 :(得分:1)

如果要将apache Httpd安装为Windows服务,则需要运行以下命令:

httpd.exe -k install

如果使用此命令,该服务将被称为Apache2.4,并且配置将被假定为conf \ httpd.conf。

如果需要指定要安装的服务的名称,请使用以下命令。如果您的计算机上有多个不同的Apache服务安装,则必须执行此操作。如果在安装期间指定了名称,则还必须在任何其他-k操作期间指定它。

httpd.exe -k install -n "MyServiceName"

如果您需要为不同的服务提供专门命名的配置文件,则必须使用:

httpd.exe -k install -n "MyServiceName" -f "c:\files\my.conf"

如果使用此命令,该服务将被称为MyServiceName,并且配置将被假定为c:\ files \ my.conf。

来源:https://httpd.apache.org/docs/current/platform/windows.html