Compile and install httpd

Compile and install httpd

First, the environmental requirements

You need to install rely apr and apr-utils, these two packages are apache package to address common cross-platform development depends

The version used:

unexpectedly-Lk7k0ktrkbz2
Apr-Util-Lk6klktrkbz2
httpd-2k4k39ktrkbsh2

Second, the specific process

  1. mkdir /apps

  2. Upload the compressed file to the / apps directory

  3. unzip files

    cd /apps

    cd /apps
    tar xvf apr-1.7.0.tar.bz2 
    tar xvf apr-util-1.6.1.tar.bz2 
    tar xvf httpd-2.4.39.tar.bz2 
    mv  apr-1.7.0/*  httpd-2.4.39/srclib/apr
    mv apr-util-1.6.1/*  httpd-2.4.39/srclib/apr-util
    
  4. Related to the installation package

    yum install gcc prce-devel openssl-devel expat-devel -y
    
  5. Compile and install

    cd httpd-2.4.39/
    
    ./configure \
    --prefix=/apps/httpd24 \
    --enable-so \
    --enable-ssl \
    --enable-cgi \
    --enable-rewrite \
    --with-zlib \
    --with-pcre \
    --with-included-apr \
    --enable-modules=most \
    --enable-mpms-shared=all \
    --with-mpm=prefork
    
    make -j 4 && make install
    
  6. Set to start shortcuts and user-initiated

    echo 'PATH=/apps/httpd24/bin:$PATH' > /etc/profile.d/httpd24.sh
    . /etc/profile.d/httpd24.sh
    useradd -s /sbin/nologin  -r apache
    
    vim /apps/httpd24/conf/httpd.conf 
    User apache
    Group apache                                                                           
    

    start up

    apachectl sart 
    

    Home access verification

    See It works! Can

Published 62 original articles · won praise 7 · views 1266

Guess you like

Origin blog.csdn.net/qq_36801585/article/details/104452296
Recommended