首页 > 其他分享 >httpd编译安装

httpd编译安装

时间:2022-12-25 20:12:34浏览次数:40  
标签:httpd liuquanyu apr root local util 编译 usr 安装

httpd编译安装

基础环境准备

[root@liuquanyu ~]# dnf -y install gcc gcc-c++ make wget
Last metadata expiration check: 2:28:48 ago on Tue 13 Dec 2022 06:32:26 PM CST.
Package gcc-8.5.0-4.el8_5.x86_64 is already installed.
Package gcc-c++-8.5.0-4.el8_5.x86_64 is already installed.
Package make-1:4.2.1-10.el8.x86_64 is already installed.
Package wget-1.19.5-10.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

下载源码安装包

在usr/src目录下使用wget命令下载三个源码安装包

[root@liuquanyu ~]# cd /usr/src/
[root@liuquanyu src]# wget https://downloads.apache.org/apr/apr-1.7.0.tar.gz https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz https://downloads.apache.org/httpd/httpd-2.4.54.tar.gz
...
Downloaded: 3 files, 11M in 6m 18s (29.5 KB/s
[root@liuquanyu src]# ls
apr-1.7.0.tar.gz       debug                kernels       
apr-util-1.6.1.tar.gz  httpd-2.4.54.tar.gz  

apr编译安装

解压源码包,并进入该目录

[root@liuquanyu src]# tar xf apr-1.7.0.tar.gz
[root@liuquanyu src]# cd apr-1.7.0
[root@liuquanyu apr-1.7.0]# ls
apr-config.in  build.conf        dso         libapr.rc     NOTICE         support
apr.dep        buildconf         emacs-mode  LICENSE       NWGNUmakefile  tables
apr.dsp        build-outputs.mk  encoding    locks         passwd         test
apr.dsw        CHANGES           file_io     Makefile.in   poll           threadproc
apr.mak        CMakeLists.txt    helpers     Makefile.win  random         time
apr.pc.in      config.layout     include     memory        README         tools
apr.spec       configure         libapr.dep  misc          README.cmake   user
atomic         configure.in      libapr.dsp  mmap          shmem
build          docs              libapr.mak  network_io    strings

指定要安装的路径

[root@liuquanyu apr-1.7.0]# ./configure --prefix=/usr/local/apr
...
config.status: include/arch/unix/apr_private.h is unchanged

检测通过后生产Makefile文件

[root@liuquanyu apr-1.7.0]# ls
apr-1-config   build             configure     libapr.dsp    misc           shmem
apr-config.in  build.conf        configure.in  libapr.mak    mmap           strings
apr.dep        buildconf         docs          libapr.rc     network_io     support
apr.dsp        build-outputs.mk  dso           libtool       NOTICE         tables
apr.dsw        CHANGES           emacs-mode    LICENSE       NWGNUmakefile  test
apr.mak        CMakeLists.txt    encoding      locks         passwd         threadproc
apr.pc         config.layout     file_io       Makefile      poll           time
apr.pc.in      config.log        helpers       Makefile.in   random         tools
apr.spec       config.nice       include       Makefile.win  README         user
atomic         config.status     libapr.dep    memory        README.cmake

执行make -j命令进行编译

[root@liuquanyu apr-1.7.0]# make -j 4
make[1]: Entering directory '/usr/src/apr-1.7.0'
...
make[1]: Leaving directory '/usr/src/apr-1.7.0'

按Makefile定义好的路径拷贝至安装目录中

[root@liuquanyu apr-1.7.0]# make install
...
done
/usr/bin/install -c -m 644 build/apr_rules.out /usr/local/apr/build-1/apr_rules.mk
/usr/bin/install -c -m 755 apr-config.out /usr/local/apr/bin/apr-1-config

apr-util编译安装

解压源码包

[root@liuquanyu src]# tar xf apr-util-1.6.1.tar.gz
[root@liuquanyu src]# cd apr-util-1.6.1
[root@liuquanyu apr-util-1.6.1]# 

指定安装路径

#还要with关联apr
[root@liuquanyu apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr  
...
config.status: creating include/private/apu_config.h
config.status: executing default commands

检测通过后生产Makefile文件

[root@liuquanyu apr-util-1.6.1]# ls
aprutil.dep     buckets           config.nice    export_vars.sh     LICENSE        README.cmake
aprutil.dsp     build             config.status  export_vars.sh.in  Makefile       README.FREETDS
aprutil.dsw     build.conf        configure      hooks              Makefile.in    redis
aprutil.mak     buildconf         configure.in   include            Makefile.win   renames_pending
apr-util.pc     build-outputs.mk  crypto         ldap               memcache       strmatch
apr-util.pc.in  CHANGES           dbd            libaprutil.dep     misc           test
apr-util.spec   CMakeLists.txt    dbm            libaprutil.dsp     NOTICE         uri
apu-1-config    config.layout     docs           libaprutil.mak     NWGNUmakefile  xlate
apu-config.in   config.log        encoding       libaprutil.rc      README         xml

执行make -j命令进行编译

[root@liuquanyu apr-util-1.6.1]# make -j 4
...
make[1]: Leaving directory '/usr/src/apr-util-1.6.1'

按Makefile定义好的路径拷贝至安装目录中

[root@liuquanyu httpd-2.4.54]# make install
...
mkdir /usr/local/apache/manual
make[1]: Leaving directory '/usr/src/httpd-2.4.54'

设置环境变量

[root@liuquanyu local]# ls
apache  apr  apr-util  bin  etc  games  include  lib  lib64  libexec  nginx  sbin  share  src
[root@liuquanyu local]# echo 'export PATH=/usr/local/apache/bin:$PATH' > /etc/profile.d/apache.sh
[root@liuquanyu local]# source /etc/profile.d/apache.sh
[root@liuquanyu local]# which httpd
/usr/local/apache/bin/httpd
[root@liuquanyu local]#

设置映射关系

[root@liuquanyu local]# ls /usr/local/apache/
bin  build  cgi-bin  conf  error  htdocs  icons  include  logs  man  manual  modules
[root@liuquanyu local]# 
[root@liuquanyu local]# ln  -s /usr/local/apache/include/  /usr/include/apache

设置man文档

[root@liuquanyu ~]# vi /etc/man_db.conf
...
#MANDATORY_MANPATH                      /usr/src/pvm3/man
#
MANDATORY_MANPATH                       /usr/man
MANDATORY_MANPATH                       /usr/share/man
MANDATORY_MANPATH                       /usr/local/share/man
MANDATORY_MANPATH                       /usr/local/apache/man

总结配置中的报错

rm: cannot remove 'libtoolT': No such file or directory
//解决办法
将configure文件中的$RM   "$cfgfile"这行代码注释掉就可以了

xml/apr_xml.c:35:10: fatal error: expat.h: No such file or directory
 #include <expat.h>
          ^~~~~~~~~
compilation terminated.
make[1]: *** [/usr/src/apr-util-1.6.1/build/rules.mk:206: xml/apr_xml.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/usr/src/apr-util-1.6.1'
make: *** [/usr/src/apr-util-1.6.1/build/rules.mk:118: all-recursive] Error 1
//解决办法
[root@node-2 apr-util-1.6.1]# yum install -y expat-devel

configure: error: APR-util not found.  Please read the documentation.
//解决办法
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/

collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:48: htpasswd] Error 1
make[2]: Leaving directory '/usr/src/httpd-2.4.54/support'
make[1]: *** [/usr/src/httpd-2.4.54/build/rules.mk:75: all-recursive] Error 1
make[1]: Leaving directory '/usr/src/httpd-2.4.54/support'
make: *** [/usr/src/httpd-2.4.54/build/rules.mk:75: all-recursive] Error 1
//解决办法
yum install -y libxml2-devel  //安装libxml2-devel
rm -rf /usr/local/apr-util   //删除apr-util目录并且重新编译安装
cd /usr/local/src/apr-util-1.6.1/
make clean
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install    重新编译安装httpd,成功解决

标签:httpd,liuquanyu,apr,root,local,util,编译,usr,安装
From: https://www.cnblogs.com/lqy0917/p/17004503.html

相关文章

  • 配置编译BusyBox
    获取源码$wget-chttp://www.busybox.net/downloads/busybox-1.23.2.tar.bz2解压并进入源码目录$tar-jxvfbusybox-1.23.2.tar.bz2$cdbusybox-1.23.2/配置$makemen......
  • manjaro安装gnome桌面环境
     步骤1.在运行以下教程之前,请确保我们的系统是最新的:sudopacman-Syu步骤2.在Manjaro20上安装GNOME桌面。 现在我们通过执行以下命令来安装GNOME包 ......
  • elasticsearch 安装8.5.3
    下载地址:https://www.elastic.co/cn/downloads/支持:https://www.elastic.co/cn/support/matrix#elastrcsearch.yml需要注意xpack安全配置修改为:falseingest.geoip.d......
  • 安装openpose,Ubuntu
    安装挺简单的,可以照着这个来官方教程gitclonehttps://github.com/CMU-Perceptual-Computing-Lab/openposecdopenpose/gitsubmoduleupdate--init--recursive--r......
  • 推荐-centos7安装高版本python3.10
    前言如果在centos7上编译安装python3.7以上版本,ssl功能会出问题,因为python3.7以后需要更高版本的openssl支持,这样的话,就需要提前编译安装高版本的openssl,比如1.1.1系列,这......
  • 关于 更换JDK时安装出错
    工具:JDK8问题:安装JDK并将环境变量配好后,DOS窗口测试时出现 Error:couldnotopen`D:\disposition\Java\java-jre\lib\amd64\jvm.cfg'解决方案1、找到原先J......
  • 编译器优化介绍
    由于内存访问速度远不及CPU处理速度,为提高机器整体性能,在硬件上引入硬件高速缓存Cache,加速对内存的访问。另外在现代CPU中指令的执行并不一定严格按照顺序执行,没有相关性的......
  • (5编译使用最新opencv)从零开始的嵌入式图像图像处理(PI+QT+OpenCV)实战演练
    从零开始的嵌入式图像图像处理(PI+QT+OpenCV)实战演练1综述2环境架设3两个例子4程序框架5编译使用最新opencv6综合实验7拾遗 为了获得最新特性,必须编译......
  • MQTT.fx客户端的安装及开始
    MQTT.fx客户端的安装及开始下载:官网:http://mqttfx.org最新版本,但是需要安装许可证,只能免费试用三个月百度网盘:只有1.7的版本,无需许可证(推荐)Windows版(64位)ht......
  • 安装GDB-ImageWatch ,在QT中查看图像
    GDB_ImageWatch是在Linux下基于QT编写图像处理程序的调试程序。由于并非像ImageWatch一样由官方提供,而是在github上以代码的方式进行提供,我们在使用的时候需要自己编......