• Linux手动安装Apache2.4


    由于环境没有administrator权限,但是需要安装apache服务,这样只有安装到自己的目录下,一次没有运行yum, apt-get.brew等权限。对于没有依赖包也需要手动一个一个的安装。

    这个方法理论上适用于所有的 Linux,我在centos和Ubuntu试过,没有问题。


    安装依赖

    1. 安装apr

    下面的xxx,均是自己的用户名,根据实际情况修改。

    wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.7.0.tar.gz
    tar -xzf apr-1.7.0.tar.gz
    cd apr-1.7.0
    ./configure --prefix=./configure --prefix=/home/xxx/bin/apr
    make && make install
    

    这里有可能有一个error: rm: cannot remove ‘libtoolT’: No such file or directory。
    解决方法就是参考这个,在配置文件里面加一个-f

    https://stackoverflow.com/questions/18091991/error-while-compiling-apache-apr-make-file-not-found

    1. 安装apr-util
    wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
    tar -xzf apr-util-1.6.1.tar.gz
    cd apr-util-1.6.1
    ./configure --prefix=/home/xxx/bin/apr-util --with-apr=/home/xxx/bin/apr
    make && make install
    
    1. 安装pcre
    wget https://ftp.pcre.org/pub/pcre/pcre-8.38.tar.gz
    tar -xzf pcre-8.38.tar.gz
    cd  pcre-8.38
    ./configure --prefix=/home/xxx/bin/pcre
    make && make install
    

    安装apache

    安装上面的一堆依赖,就可以安装apache了。

    wget http://www.apache.org/dist/httpd/httpd-2.4.41.tar.gz
    tar -xzf httpd-2.4.41.tar.gz
    cd httpd-2.4.41
    ./configure --prefix=/home/xxx/bin/apache2.4 --with-apr=/home/xxx/bin/apr --with-apr-util=/home/xxx/bin/apr-util --with-pcre=/home/xxx/bin/pcre --enable-module=so
    make && make install
    

    运行apache

    安装上面的步骤,基本上就快完成了。还有一个一步。

    cd /home/xxx/bin/apache2.4
    ./apachectl start
    

    如果没有任何报错的花,大功告成。通过IP就可以访问了。

  • 相关阅读:
    storm环境搭建
    环境变量
    vmware tools安装及使用其实现与宿主机共享文件夹
    关于mysql中的count()函数
    centos7配置jdk8
    linux常用命令(随时更新中)
    ES中对索引的相关操作
    linux centos7下源码 tar安装mysql5.7.23(5.7以上均可试用)
    安装linux虚拟机配置静态ip(桥接模式,外部机器能够访问)
    安装linux虚拟机配置静态ip(NAT模式)
  • 原文地址:https://www.cnblogs.com/ievjai/p/14382668.html
Copyright © 2020-2023  润新知