【发布时间】:2011-10-25 19:30:03
【问题描述】:
我是 C 编程方面的新手,我只是使用 记事本 来编写我的 C 应用程序。现在我正在学习如何在 C 中创建 apache http 服务器模块。我知道如何为 apache 创建 C 模块,但是这个过程是重复并且令人厌烦。例如,当我修改模块的 C 源代码时,我需要重复整个过程。所以,现在我正在寻找可以自动化该过程的工具。
下面是用 C 语言构建 apache 模块的过程:
- 启动 Visual Studio 命令提示符 (2010)
- 将目录更改为 apache bin 目录:
cd C:\PROGRA~1\APACHE~1\Apache2.2\bin - 运行此命令:
apxs -llibhttpd -llibapr-1 -llibaprutil-1 -c mod_helloworld.c - 注意:此命令将创建
mod_helloworld.so文件 - 使用此命令停止 apache 服务器:
net stop apache2.2 - 复制
mod_helloworld.so文件到C:\PROGRA~1\APACHE~1\Apache2.2\modules文件夹 - 运行此命令:
apxs -i -n "helloworld" mod_helloworld.la - 使用此命令启动 apache 服务器:
net start apache2.2 - 在 Firefox 中浏览网页以观察 apache 模块中所做的最新更改
我的 apache 模块的目的是提供 动态网页。所以我经常需要对模块进行更改。现在我重复我的问题:What are the tools for me to automate this repetitive process?
【问题讨论】:
-
如果步骤这么简单,您可以从编写 .bat 文件开始。
-
一个简单的
.cmd脚本可以处理(除了浏览部分,这就是你做的)。 -
@James McNellis:谢谢,我需要 google 一下 .bat 文件。我不知道那是什么。
标签: c windows apache automation httpmodule