【问题标题】:Automation tools for building C application using Notepad使用记事本构建 C 应用程序的自动化工具
【发布时间】:2011-10-25 19:30:03
【问题描述】:

我是 C 编程方面的新手,我只是使用 记事本 来编写我的 C 应用程序。现在我正在学习如何在 C 中创建 apache http 服务器模块。我知道如何为 apache 创建 C 模块,但是这个过程是重复并且令人厌烦。例如,当我修改模块的 C 源代码时,我需要重复整个过程。所以,现在我正在寻找可以自动化该过程的工具。

下面是用 C 语言构建 apache 模块的过程:

  1. 启动 Visual Studio 命令提示符 (2010)
  2. 将目录更改为 apache bin 目录:cd C:\PROGRA~1\APACHE~1\Apache2.2\bin
  3. 运行此命令:apxs -llibhttpd -llibapr-1 -llibaprutil-1 -c mod_helloworld.c
  4. 注意:此命令将创建mod_helloworld.so 文件
  5. 使用此命令停止 apache 服务器:net stop apache2.2
  6. 复制mod_helloworld.so文件到C:\PROGRA~1\APACHE~1\Apache2.2\modules文件夹
  7. 运行此命令:apxs -i -n "helloworld" mod_helloworld.la
  8. 使用此命令启动 apache 服务器:net start apache2.2
  9. 在 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


【解决方案1】:

根据您的描述,您可能会将其粘贴到 .bat 文件中,然后运行它

cd C:\PROGRA~1\APACHE~1\Apache2.2\bin
apxs -llibhttpd -llibapr-1 -llibaprutil-1 -c mod_helloworld.c
net stop apache2.2
copy mod_helloworld.so C:\PROGRA~1\APACHE~1\Apache2.2\modules
apxs -i -n "helloworld" mod_helloworld.la
net start apache2.2

一般来说,如果您发现自己一遍又一遍地运行一系列命令,是时候将它们全部放入某种脚本中了

【讨论】:

    猜你喜欢
    • 2011-01-13
    • 1970-01-01
    • 2020-06-10
    • 1970-01-01
    • 2019-03-22
    • 1970-01-01
    • 1970-01-01
    • 2013-04-01
    • 2016-04-04
    相关资源
    最近更新 更多