apache移植

我下载的是httpd-2.2.9.tar.gz 1. 解压httpd-2.2.9.tar.gz到/mnt/apps目录下。tar -zxvf httpd-2.2.9.tar.gz

2. 建立与httpd-2.2.9平级的目录。如apache-arm

3. 进入/mnt/apps/httpd-2.2.9/srclib/apr/include目录。修改apr_want.h文件。将 struct iovec {     char *iov_base;     size_t iov_len; };修改为 #if 0 struct iovec {     char *iov_base;     size_t iov_len; }; #endif

4. ./configure CC=arm-linux-gcc --host=arm-linux --prefix=/mnt/apps/apache-arm --enable-so --enable-modules=so --with-mpm=prefork ac_cv_file__dev_zero=yes ac_cv_func_setpgrp_void=yes apr_cv_process_shared_works=yes apr_cv_mutex_robust_shared=yes apr_cv_tcp_nodelay_with_cork=yes ap_void_ptr_lt_long=no

5. make 将会出现如下错误:./dftables: ./dftables: cannot execute binary file。解决方法:编译一个本地版本的apache。./configure --enable-so --with-mpm=worker ;make。然后将本地版本中的dftables拷贝到arm版本中来。

6. 继续make将会出现如下错误:/bin/sh: ./gen_test_char: cannot execute binary file。解决方法:将本地版本中的gen_test_char拷贝到arm版本中来。(注意:执行5、6两步的拷贝时一定要保证本地版本的dftables和gen_test_char修改时间比arm版本的修改时间新,可以用touch -m命令将这2个文件的修改时间设置为当前时间再覆盖arm版本的相同文件)

7. make install

8. 用arm-linux-strip命令将生成的所有2进制文件strip一下。

9. 将apache-arm整个目录拷贝到arm板的/usr/local目录下。当然符号链接不能拷贝,所以还得在arm板上创建几个符号链接(/mnt/apps/apache-arm/lib目录下)。ln -s libapr-1.so.0.3.0 libapr-1.so.0;ln -s libaprutil-1.so.0.3.0 libaprutil-1.so.0;ln -s libexpat.so.0.1.0 libexpat.so.0

11.启动apache。httpd start

12. 在浏览器中输入:http://x.x.x.x:index.html 若出现It Works!则表明安装成功。

有志者事竟成
原文地址:https://www.cnblogs.com/dancheblog/p/3508676.html