EverKB

Knowledge Base Ever

CentOS7에서 Apache 2.4 컴파일 및 설치

2019-11-15 12:18:53

라벨: CentOS, Apache, CentOS7, Apache2.4, Compiling Apache, Apache httpd2.4컴파일

CentOS7에는 Apache httpd(이하 httpd) 서비스가 제공되며,이 서비스를 컴퓨터에 포함시키지 않으면 yum을 사용하여 설치할 수 있습니다.

httpd2.4와 같은 새 버전의 httpd를 설치해야하는 경우 직접 컴파일해야합니다. 컴파일 프로세스는 복잡하지 않으며 종속 패키지 만 컴파일 및 설치하면 전체 프로세스가 다소 복잡해집니다.

이전 버전을 설치 제거하고 빌드 도구를 설치 한 후 이전 버전의 설치 패키지를 설치 제거하십시오.

yum -y remove httpd

yum -y install gcc gcc-c++
yum -y group install "Development Tools"

yum -y remove apr apr-devel apr-util apr-util-devel

4 월 설치

cd /usr/local/src/
yum -y install wget
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.7.0.tar.gz
tar xf apr-1.7.0.tar.gz
cd apr-1.7.0
./configure --prefix=/usr/local/apr
make && make install

apr-util 설치

yum -y install expat-devel

cd /usr/local/src/
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
tar xf apr-util-1.6.1.tar.gz 
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config 
make && make install

pcre 설치

cd /usr/local/src/
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.43.tar.gz
tar xf pcre-8.43.tar.gz 
cd pcre-8.43
./configure --prefix=/usr/local/pcre  
make && make install

httpd 컴파일

cd /usr/local/src/
wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.39.tar.gz
tar xf httpd-2.4.39.tar.gz
cd httpd-2.4.39
./configure --prefix=/usr/local/apache --enable-rewrite --enable-so --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
make && make install

/etc/init.d/httpd구성 파일을 편집하고 시작하도록 systemctl을 구성하십시오.

#!/bin/bash
# chkconfig: 12345 80 90
function start_http()
{
    /usr/local/apache/bin/apachectl start
}
function stop_http()
{
    /usr/local/apache/bin/apachectl stop
}
case "$1" in
start)
    start_http
;;
stop)
    stop_http
;;
restart)
    stop_http
    start_http
;;
*)
    echo "Usage : start | stop | restart"
;;
esac

실행 권한 설정, 서비스 시작 및 부팅시 부팅하도록 설정

chmod a+x /etc/init.d/httpd
systemctl daemon-reload
systemctl start httpd
chkconfig --add httpd

라벨

CentOS7 CentOS PHP Linux Python3 Python MySQL MariaDB YUM JavaScript MySQL8 caching_sha2_password HTML mysql_native_password PHP7 CSS Redis set_error_handler TestCase Compiling PHP frequency conflict PHPUnit ss5.conf apr Elasticsearch7.3 particles.js Slim Vincent Garreau daemon HTTP Sudo Failed to build these modules: _uuid MongoDB pg_bha.conf SQL Server width DATE_ADD ip command scrollbar Tcp BBR Compiling Apache Frameworks MySQL-python PHPStorm ss5-3.8.9 Apache2.4 Elasticsearch libpython3.7m.so.1.0 NodeJs show VIM CURLOPT_POSTFIELDS substr Bluetooth Failed to build these modules: _ctypes Minimal ISO PECL SQL Date Funcitons Wi-Fi date sub INTERVAL root Tag Cloud CodeIgniter font-size ss5 apache httpd dual network interfaces Laravel node.js ShadowsocksR vertical-align CURLFille horiz-align PyCharm SUBDATE BarManager exec mb_substr PEAR SOCKS5 Proxy Server WebStorm date add IntelliJIDEA remi Tag Chrome find PHP5.5 src Apache du jQuery Shadowsocks-Python V2Ray cURL hide nginx PostgreSQL sub folder availability eth0 MariaDB10.4 pdo_sqlsrv SOCKS5 Web Server date Install MongoDB register_shutdown_function Symfony File Upload mssql-tools php-fpm sqlsrv Zend Framework ADDDATE DevExpress JetBrain Shadowsocks-Libev unixODBC-devel height network interface Port 80 string Aura error_get_last password policy requirements SOCKS Web Development data INDENTIFIED BY Redis5 SVN Fedora Media Writer msodbcsql SQLAlchemy absolute Deepin jemalloc Shadowsocks toggle convert FuelPHP mysqlclient PHPUnit Framework ss5.passwd at-symbol Error Control Operator margin password SOCKET vps daemon process IIS sudoers center Fatal Errors MongoDB4 Phalcon SQL Server 2017 WiFi .htaccess DATE_SUB

최신 기사