注:/usr/local/apache/为Apache的安装路径,/opt/httpd-2.0.55/为Apache的源代码目录。
Linux下,执行以下命令为Apache添加mod_expires模块:
/usr/local/apache/bin/apxs -i -a -c /opt/httpd-2.0.55/modules/metadata/mod_expires.c
报错:
引用
Warning! dlname not found in /usr/local/apache/modules/mod_expires.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache/modules/mod_expires.so
chmod: 无法访问‘/usr/local/apache/modules/mod_expires.so’: 没有那个文件或目录
apxs:Error: Command failed with rc=65536
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache/modules/mod_expires.so
chmod: 无法访问‘/usr/local/apache/modules/mod_expires.so’: 没有那个文件或目录
apxs:Error: Command failed with rc=65536
再执行:
gcc -shared -o /usr/local/apache/modules/mod_expires.so /opt/httpd-2.0.55/modules/metadata/mod_expires.o
/usr/local/apache/bin/apxs -i -a -c /opt/httpd-2.0.55/modules/metadata/mod_expires.c
/usr/local/apache/bin/apxs -i -a -c /opt/httpd-2.0.55/modules/metadata/mod_expires.c
编译成功。