热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

HowtocompileApache2.2.11toARM

2019独角兽企业重金招聘Python工程师标准HowtocompileApache-2.2.11toARMByfollowingthesestepsyouhavegreat

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

How to compile Apache-2.2.11 to ARM


By following these steps you have great chances to compile a recent Apache to your ARM system. This is how I made it.


Toolchain

My big-endian ARM toolchain was made with Buildroot. uClibc-0.9.30, binutils-2.18, gcc-4.2.1.

Determine the so called "triplet" of your toolchain. The easiest way is to locate the cross compiler (gcc) in your toolchain directory and see prefix of gcc. In my case this is armeb-linux-uclibc. Some packages refuse this long triplet, they prefer something more traditional, or no one knows what, but armeb-linux is usually adequate to them too. In my case armeb-linux-gcc is just a symlink to armeb-linux-uclibc-gcc, but for the choosy configure scripts this also suits. Triplet is referenced as TRIPLET (armeb-linux-uclibc) in this document.

Dependencies

Apache depends on pcre, Perl Compatible Regular Expressions. In the httpd package you can find a package of pcre amongst others (Apache Portable Runtime), in case of a default compile (e.g. on x86) this package is perfect for compiling Apache. In this case of ARM we neglect this builtin package, rather use an external package.

Apache relies on APR libraries and utils. APR is the abbreviation of Apache Portable Runtime. These packages must be compiled before the final webserver can be built. In a default case they would be built automatically during the build process of Apache, but this is not the default case, so we'll handle this also manually.

Other relevant dependencies are not known by me.

Compile target directories

The target directory you intend to put the compiled libraries and binaries is depending on you highly. In this article two important directories will be used.

The first one is a development directory for development packages. Into this directory those packages (dynamic and static libraries, headers and so on) will be put that are needed to compile an other package. Typically this target directory is the usr/ subpath of your toolchain's directory, since the toolchain is capable of finding headers and libraries located under its directory structure without any additional compile flag. And in most cases the toolchain is the best place to collect all the files that are essential in compiling other packages. Toolchain directory will be referred as TOOLCHAIN_DIR.

The second directory is the location where you want to put the compiled package. This will typically consist of executables, configuration files, man pages and libraries. This is usually a path in your root filesystem. Under a regular x86 system when you compile native programs, this can be for example either /usr or /usr/local. In case of cross-compiling, something like this is possible: /home/user/arm-project/rootfs. This directory will be referred as ROOTFS_DIR.

pcre-7.9

Download package.

Nothing special, this can be cross-compiled to ARM easily.

cd pcre-7.9; /

./configure /

--host=$TRIPLET /

--prefix=$TOOLCHAIN_DIR/usr; /

make; /

make install

httpd-2.2.18 (Apache)

Download e.g. from here (Hungarian server, locate an other mirror if slow).

APR

Autoconf variables may have other values depending on your toolchain/machine.

cd httpd-2.2.18/srclib/apr; /

ac_cv_file__dev_zero="yes" /

ac_cv_func_setpgrp_void="yes" /

apr_cv_tcp_nodelay_with_cork="yes" /

ac_cv_sizeof_struct_iovec="8" /

./configure /

--host=$TRIPLET /

--prefix=$ROOTFS_DIR/usr/apache; /

make; /

make install

APR util

Autoconf variable may have other value depending on your toolchain/machine.

cd httpd-2.2.18/srclib/apr-util; /

./configure /

--host=$TRIPLET /

--prefix=ROOTFS_DIR/usr/apache /

--with-apr=$ROOTFS_DIR/usr/apache; /

make; /

make install

httpd

Autoconf variables may have other values depending on your toolchain/machine. They have to be set manually, because configure script is unable to guess their values.

cd httpd-2.2.18; /

ap_cv_void_ptr_lt_long=no /

LDFLAGS="-lpthread" /

./configure /

--host=$TRIPLET /

--prefix=/usr/apache /

--with-apr=$ROOTFS_DIR/usr/apache /

--with-apr-util=$ROOTFS_DIR/usr/apache /

--with-pcre=$TOOLCHAIN_DIR/usr /

--enable-so /

--enable-cgi; /

make; /

DESTDIR=$ROOTFS_DIR make install

Last steps

To check the runtime library dependencies of httpd, use the $TRIPLET-ldd program. libpcre is obviously needed:

cp $TOOLCHAIN_DIR/usr/lib/libpcre.so* $ROOTFS_DIR/usr/lib

Don't forget to configure your new httpd (httpd.conf).

Have fun!


转:https://my.oschina.net/u/174242/blog/72925



推荐阅读
  • com.sun.javadoc.PackageDoc.exceptions()方法的使用及代码示例 ... [详细]
  • 本文介绍如何通过 Python 的 `unittest` 和 `functools` 模块封装一个依赖方法,用于管理测试用例之间的依赖关系。该方法能够确保在某个测试用例失败时,依赖于它的其他测试用例将被跳过。 ... [详细]
  • Ihavetwomethodsofgeneratingmdistinctrandomnumbersintherange[0..n-1]我有两种方法在范围[0.n-1]中生 ... [详细]
  • 本文介绍如何使用 Python 的 DOM 和 SAX 方法解析 XML 文件,并通过示例展示了如何动态创建数据库表和处理大量数据的实时插入。 ... [详细]
  • 开机自启动的几种方式
    0x01快速自启动目录快速启动目录自启动方式源于Windows中的一个目录,这个目录一般叫启动或者Startup。位于该目录下的PE文件会在开机后进行自启动 ... [详细]
  • 本文讨论了在进行 MySQL 数据迁移过程中遇到的所有 .frm 文件报错的问题,并提供了详细的解决方案和建议。 ... [详细]
  • 本文将详细介绍如何在Mac上安装Jupyter Notebook,并提供一些常见的问题解决方法。通过这些步骤,您将能够顺利地在Mac上运行Jupyter Notebook。 ... [详细]
  • 本文详细介绍了 InfluxDB、collectd 和 Grafana 的安装与配置流程。首先,按照启动顺序依次安装并配置 InfluxDB、collectd 和 Grafana。InfluxDB 作为时序数据库,用于存储时间序列数据;collectd 负责数据的采集与传输;Grafana 则用于数据的可视化展示。文中提供了 collectd 的官方文档链接,便于用户参考和进一步了解其配置选项。通过本指南,读者可以轻松搭建一个高效的数据监控系统。 ... [详细]
  • 在Cisco IOS XR系统中,存在提供服务的服务器和使用这些服务的客户端。本文深入探讨了进程与线程状态转换机制,分析了其在系统性能优化中的关键作用,并提出了改进措施,以提高系统的响应速度和资源利用率。通过详细研究状态转换的各个环节,本文为开发人员和系统管理员提供了实用的指导,旨在提升整体系统效率和稳定性。 ... [详细]
  • 本文详细介绍了在 CentOS 7 系统中配置 fstab 文件以实现开机自动挂载 NFS 共享目录的方法,并解决了常见的配置失败问题。 ... [详细]
  • 本文介绍了几种常用的图像相似度对比方法,包括直方图方法、图像模板匹配、PSNR峰值信噪比、SSIM结构相似性和感知哈希算法。每种方法都有其优缺点,适用于不同的应用场景。 ... [详细]
  • 本文介绍了如何使用Python的Paramiko库批量更新多台服务器的登录密码。通过示例代码展示了具体实现方法,确保了操作的高效性和安全性。Paramiko库提供了强大的SSH2协议支持,使得远程服务器管理变得更加便捷。此外,文章还详细说明了代码的各个部分,帮助读者更好地理解和应用这一技术。 ... [详细]
  • 在CentOS 7环境中安装配置Redis及使用Redis Desktop Manager连接时的注意事项与技巧
    在 CentOS 7 环境中安装和配置 Redis 时,需要注意一些关键步骤和最佳实践。本文详细介绍了从安装 Redis 到配置其基本参数的全过程,并提供了使用 Redis Desktop Manager 连接 Redis 服务器的技巧和注意事项。此外,还探讨了如何优化性能和确保数据安全,帮助用户在生产环境中高效地管理和使用 Redis。 ... [详细]
  • 本文介绍了如何利用Shell脚本高效地部署MHA(MySQL High Availability)高可用集群。通过详细的脚本编写和配置示例,展示了自动化部署过程中的关键步骤和注意事项。该方法不仅简化了集群的部署流程,还提高了系统的稳定性和可用性。 ... [详细]
  • 为了确保iOS应用能够安全地访问网站数据,本文介绍了如何在Nginx服务器上轻松配置CertBot以实现SSL证书的自动化管理。通过这一过程,可以确保应用始终使用HTTPS协议,从而提升数据传输的安全性和可靠性。文章详细阐述了配置步骤和常见问题的解决方法,帮助读者快速上手并成功部署SSL证书。 ... [详细]
author-avatar
爱情失挖_904
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有