>  기사  >  운영 및 유지보수  >  centos7에서 Apache를 최신 버전으로 업그레이드하십시오.

centos7에서 Apache를 최신 버전으로 업그레이드하십시오.

王林
王林앞으로
2020-06-17 16:47:199032검색

centos7에서 Apache를 최신 버전으로 업그레이드하십시오.

1단계: 기본 소프트웨어 저장소에서 Apache 버전 찾기

Centos의 소프트웨어 저장소에서 Apache 버전을 찾으려면 명령줄에 다음 명령을 입력하세요.

yum info httpd

centos가 기본값을 구성하면 비슷한 결과를 얻을 가능성이 높습니다.

[root@crosp ~]# yum info httpd
Loaded plugins: fastestmirror
epel/x86_64/metalink                                     |  19 kB     00:00
epel                                                     | 4.3 kB     00:00
(1/3): epel/x86_64/group_gz                                | 170 kB   00:00
(2/3): epel/x86_64/primary_db                              | 4.6 MB   00:00
(3/3): epel/x86_64/updateinfo                              | 780 kB   00:00
Loading mirror speeds from cached hostfile
 * base: mirrors.ircam.fr
 * epel: mirrors.ircam.fr
 * extras: centos.mirror.fr.planethoster.net
 * updates: centos.mirror.fr.planethoster.net
Available Packages
Name        : httpd
Arch        : x86_64
Version     : 2.4.6
Release     : 45.el7.centos.4
Size        : 2.7 M
Repo        : updates/7/x86_64
Summary     : Apache HTTP Server
URL         : http://httpd.apache.org/
License     : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
            : web server.

위 출력에서 ​​볼 수 있듯이 기본 소프트웨어 라이브러리에는 Apache 버전 2.4.6만 있습니다.

참고:

Centos는 이전 버전의 수정 사항 보안 방식을 사용하여 이전 버전에 새로운 소프트웨어 수정 사항을 적용합니다. 따라서 기본 저장소에 있는 이전 버전의 소프트웨어가 더 취약하다는 의미는 아닙니다. 하지만 나에게는 내 요구 사항을 충족하는 업데이트가 아닙니다.

변경 로그를 사용하여 버전 업데이트를 확인할 수 있습니다.

sudo yum install yum-changelog
yum changelog httpd

2단계: CodeIT 라이브러리 설치

CodeIT 직원은 훌륭한 사용자 정의 라이브러리를 제공합니다. 이 저장소는 최신 버전의 서버 소프트웨어(Apache 및 Nginx)를 제공합니다.

CodeIT 라이브러리를 설치하기 전에 EPEL을 활성화해야 합니다. EPEL은 CodeIT 라이브러리에 필요한 종속성을 제공합니다.

sudo yum install -y epel-release

마지막으로 CodeIT 라이브러리를 설치하겠습니다

cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo

다음으로 Apache의 패키지 버전을 다시 확인하면 아래와 유사한 출력이 표시됩니다.

[root@crosp ~]# yum info httpd
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.crazyfrogs.org
 * epel: mirror.23media.de
 * extras: mirrors.ircam.fr
 * updates: centos.mirror.fr.planethoster.net
Available Packages
Name        : httpd
Arch        : x86_64
Version     : 2.4.25
Release     : 3.el7.codeit
Size        : 1.4 M
Repo        : CodeIT/x86_64
Summary     : Apache HTTP Server
URL         : http://httpd.apache.org/
License     : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
            : web server.

3단계: Apache 설치

이제 다음은 최신 버전의 Apache를 설치하는 데 필요한 모든 것입니다.

yum install httpd

Apache가 설치되면 Apache가 제대로 작동하는지 테스트할 수 있습니다.

[root@crosp ~]# systemctl start httpd

출력은 다음 이미지와 같아야 합니다.

[root@crosp ~]# curl localhost
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Test Page for the Apache HTTP Server on CentOS</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                ...

마지막으로 systemctl set을 설정합니다. Apache 부팅 자체 시작:

[root@crosp ~]# systemctl enable httpd

완료.

추천 튜토리얼: apache부터 마스터까지

위 내용은 centos7에서 Apache를 최신 버전으로 업그레이드하십시오.의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 csdn.net에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제