使用apxs工具给apache添加模块,不需重新编译安装apache
httpd源码已解压
cd /usr/local/src/httpd-2.4.3/modules/generators/
/usr/local/apache/bin/apxs -i -a -c mod_cgi.c
apxs命令添加模块,查看/usr/local/apache2/modules/可找到mod_cgi.so
在配置文件httpd.conf中可以找到
LoadModule cgi_module libexec/mod_cgi.so
转自:http://blog.chinaunix.net/space.php?uid=17305065&do=blog&id=1739439
该网友描述更详细。感谢