2018년 August 17일
  1. 클라우드
  2. Build Apache 2.4.10 RPM on CentOS 6.7 (1)

Build Apache 2.4.10 RPM on CentOS 6.7 (1)

CentOS 6.0에 기본 설치되는 Apache 2.2.x 와 Php 5.3.x 버전을 Apache 2.4.x 와 Php 7.x 버전으로 업그레이드 하는 방법을 설명합니다. 이 방법에는 다음의 2가지 방법이 있습니다.

방법 1. Php 7.x 업그레이드, 이후 Httpd 2.4.x 로 업그레이드
방법 2. Httpd 2.4.x로 업그레이드, 이후 Php 7.x로 업그레이드

진행 전에 CentOS 6.7 버전에서 설치 가능한 Apache와 Php가 설치되지 않은 경우 다음 명령어를 통해 설치합니다.

—————————————————————————————————————————————————-

# sudo su –
# cd
# yum install yum install wget rpm-build autoconf zlib-devel libselinux-devel libuuid-devel pcre-devel openldap-devel lua-devel libxml2-devel distcache-devel openssl-devel apr-devel postgresql-devel mysql-devel sqlite-devel freetds-devel unixODBC-devel nss-devel distcache-devel expat-devel db4-devel mailcap libtool doxygen

Apache 설치

# yum install httpd

Php 설치

# yum install php php-fpm php-cli php-common php-mbstring php-gd php-intl php-xml php-mysql php-mcrypt php-zip php-curl php-pear

설치 이후, http://example.com/index.php 해서 phpinfo() 가 올바르게 출력되는지 확인

———————————————————————————————————————————————-

방법 1. Php 7.x 업그레이드, 이후 Httpd 2.4.x 로 업그레이드

(1) Php 7 업그레이드 : epel repository 

# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
# rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm

# cd /etc/yum.repos.d/
# vi remi-php70.repo
enabled=0 -> enabled=1

# yum update

설치 후 php 버전 확인 및 Apache restart합니다.

# php –version
# service httpd restart

그리고 http://example.com/index.php 해서 Php 7 버전으로 업그레이드 되었는지 확인합니다.

(2) Httpd 업그레이드

패키지 다운로드

# wget https://archive.apache.org/dist/apr/apr-1.5.1.tar.bz2
# wget https://archive.apache.org/dist/apr/apr-util-1.5.3.tar.bz2
# wget http://epel.unix.website/archive/fedora/linux/releases/18/Fedora/source/SRPMS/d/distcache-1.4.5-23.src.rpm
# wget http://download.mostlylinux.com/6.4/x86_64/os/Packages/freetds-0.82-6.el6.x86_64.rpm
# wget http://download.mostlylinux.com/6.4/x86_64/os/Packages/freetds-devel-0.82-6.el6.x86_64.rpm
# wget https://archive.apache.org/dist/httpd/httpd-2.4.10.tar.bz2

Build and Install Apache Portable Runtime RPMs

# rpmbuild -tb apr-1.5.1.tar.bz2
# rpm -Uvh /root/rpmbuild/RPMS/x86_64/apr-1.5.1-1.x86_64.rpm /root/rpmbuild/RPMS/x86_64/apr-devel-1.5.1-1.x86_64.rpm

[에러] freetds-devel is needed by apr-util-1.5.3-1.x86_64
# rpm -Uvh freetds-0.82-6.el6.x86_64.rpm freetds-devel-0.82-6.el6.x86_64.rpm

# rpmbuild -tb apr-util-1.5.3.tar.bz2

[에러] apr-devel >= 1.4.0 is needed by apr-util-1.5.3-1.x86_64

# cd /root/rpmbuild/RPMS/x86_64
# rpm -Uvh apr-util-*

distcache 설치하기

# rpmbuild –rebuild distcache-1.4.5-23.src.rpm
# cd /root/rpmbuild/RPMS/x86_64
# rpm -Uvh distcache*.rpm

apache 빌드하기

# cd
# rpmbuild -tb httpd-2.4.10.tar.bz2

[에러] lua-devel is needed by httpd-2.4.6-1.x86_64

# wget http://ftp.stu.edu.tw/Linux/CentOS/6/os/x86_64/Packages/lua-devel-5.1.4-4.1.el6.x86_64.rpm
# rpm -Uvh lua-devel-5.1.4-4.1.el6.x86_64.rpm

# rpmbuild -tb httpd-2.4.10.tar.bz2
# cd /root/rpmbuild/RPMS/x86_64
# rpm -Uvh httpd*.rpm

[에러] httpd-mmn = 20051115 is needed by (installed) php-5.3.3-49.el6.x86_64

# rpm remove php-common
# rpm -Uvh httpd*.rpm

만약 service httpd stop 안되면 reboot

내용이 길어져서 Httpd 2.4로 업그레이드, 이후 PHP 7 업그레이드 방법은 다음 글에서 알아 보겠습니다.

Leave a Reply

Your email address will not be published. Required fields are marked *

연관 글
BCT NEWS
인기 글
AI 트레이닝 센터
워드프레스 유지보수
워드프레스 유지보수
BCT AI Chatbot