Linux [CenOS 6.8] Apache 2.2.15 설치하기
페이지 정보
본문
1. 아파치 설치 확인
CentOS를 기본 설치했다면 httpd이 설치되어 있습니다.
CentOS를 최소 설치(minimal installation)했다면 httpd이 설치되어 있지 않습니다.
[root@localhost /]# rpm -qa httpd
[root@localhost /]# ps -df | grep httpd
root 11479 9879 0 22:05 pts/0 00:00:00 grep httpd
[root@localhost /]# /etc/rc.d/init.d/httpd stop
-bash: /etc/rc.d/init.d/httpd: No such file or directory
[root@localhost /]# yum remove -q httpd
No Match for argument: httpd
[root@localhost /]# find / -name apachectl
※ usr/local/apache/bin/apachectl 설치된 경우
[root@localhost /]# rm -rf /usr/local/apache
2. 설치 가능한 아파치 종류
[root@localhost /]# yum list httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* extras: www.ftp.ne.jp
* updates: www.ftp.ne.jp
Available Packages
httpd.x86_64 2.2.15-56.el6.centos.3 updates
3. yum 으로 아파치 설치
[root@localhost src]# yum install httpd
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* extras: www.ftp.ne.jp
* updates: www.ftp.ne.jp
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-56.el6.centos.3 will be installed
--> Processing Dependency: httpd-tools = 2.2.15-56.el6.centos.3 for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-56.el6.centos.3 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
httpd x86_64 2.2.15-56.el6.centos.3 updates 834 k
Installing for dependencies:
apr x86_64 1.3.9-5.el6_2 base 123 k
apr-util x86_64 1.3.9-3.el6_0.1 base 87 k
apr-util-ldap x86_64 1.3.9-3.el6_0.1 base 15 k
httpd-tools x86_64 2.2.15-56.el6.centos.3 updates 79 k
mailcap noarch 2.1.31-2.el6 base 27 k
Transaction Summary
================================================================================
Install 6 Package(s)
Total download size: 1.1 M
Installed size: 3.7 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): apr-1.3.9-5.el6_2.x86_64.rpm | 123 kB 00:00
(2/6): apr-util-1.3.9-3.el6_0.1.x86_64.rpm | 87 kB 00:00
(3/6): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm | 15 kB 00:00
(4/6): httpd-2.2.15-56.el6.centos.3.x86_64.rpm | 834 kB 00:00
(5/6): httpd-tools-2.2.15-56.el6.centos.3.x86_64.rpm | 79 kB 00:00
(6/6): mailcap-2.1.31-2.el6.noarch.rpm | 27 kB 00:00
--------------------------------------------------------------------------------
Total 2.2 MB/s | 1.1 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : apr-1.3.9-5.el6_2.x86_64 1/6
Installing : apr-util-1.3.9-3.el6_0.1.x86_64 2/6
Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 3/6
Installing : httpd-tools-2.2.15-56.el6.centos.3.x86_64 4/6
Installing : mailcap-2.1.31-2.el6.noarch 5/6
Installing : httpd-2.2.15-56.el6.centos.3.x86_64 6/6
Verifying : httpd-2.2.15-56.el6.centos.3.x86_64 1/6
Verifying : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 2/6
Verifying : apr-1.3.9-5.el6_2.x86_64 3/6
Verifying : httpd-tools-2.2.15-56.el6.centos.3.x86_64 4/6
Verifying : mailcap-2.1.31-2.el6.noarch 5/6
Verifying : apr-util-1.3.9-3.el6_0.1.x86_64 6/6
Installed:
httpd.x86_64 0:2.2.15-56.el6.centos.3
Dependency Installed:
apr.x86_64 0:1.3.9-5.el6_2
apr-util.x86_64 0:1.3.9-3.el6_0.1
apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1
httpd-tools.x86_64 0:2.2.15-56.el6.centos.3
mailcap.noarch 0:2.1.31-2.el6
Complete!
4. 아파치 확인
[root@localhost /]# rpm -qa httpd
httpd-2.2.15-56.el6.centos.3.x86_64
5. 아파치 실행
[root@localhost /]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
[ OK ]
6. 재부팅시 자동 시작
[root@localhost /]# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost /]# chkconfig httpd on
[root@localhost /]# chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
7. 튜닝 하기
참고자료
http://zetawiki.com/wiki/CentOS_아파치_설치
CentOS를 기본 설치했다면 httpd이 설치되어 있습니다.
CentOS를 최소 설치(minimal installation)했다면 httpd이 설치되어 있지 않습니다.
[root@localhost /]# rpm -qa httpd
[root@localhost /]# ps -df | grep httpd
root 11479 9879 0 22:05 pts/0 00:00:00 grep httpd
[root@localhost /]# /etc/rc.d/init.d/httpd stop
-bash: /etc/rc.d/init.d/httpd: No such file or directory
[root@localhost /]# yum remove -q httpd
No Match for argument: httpd
[root@localhost /]# find / -name apachectl
※ usr/local/apache/bin/apachectl 설치된 경우
[root@localhost /]# rm -rf /usr/local/apache
2. 설치 가능한 아파치 종류
[root@localhost /]# yum list httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* extras: www.ftp.ne.jp
* updates: www.ftp.ne.jp
Available Packages
httpd.x86_64 2.2.15-56.el6.centos.3 updates
3. yum 으로 아파치 설치
[root@localhost src]# yum install httpd
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* extras: www.ftp.ne.jp
* updates: www.ftp.ne.jp
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-56.el6.centos.3 will be installed
--> Processing Dependency: httpd-tools = 2.2.15-56.el6.centos.3 for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-56.el6.centos.3.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-56.el6.centos.3 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
httpd x86_64 2.2.15-56.el6.centos.3 updates 834 k
Installing for dependencies:
apr x86_64 1.3.9-5.el6_2 base 123 k
apr-util x86_64 1.3.9-3.el6_0.1 base 87 k
apr-util-ldap x86_64 1.3.9-3.el6_0.1 base 15 k
httpd-tools x86_64 2.2.15-56.el6.centos.3 updates 79 k
mailcap noarch 2.1.31-2.el6 base 27 k
Transaction Summary
================================================================================
Install 6 Package(s)
Total download size: 1.1 M
Installed size: 3.7 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): apr-1.3.9-5.el6_2.x86_64.rpm | 123 kB 00:00
(2/6): apr-util-1.3.9-3.el6_0.1.x86_64.rpm | 87 kB 00:00
(3/6): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm | 15 kB 00:00
(4/6): httpd-2.2.15-56.el6.centos.3.x86_64.rpm | 834 kB 00:00
(5/6): httpd-tools-2.2.15-56.el6.centos.3.x86_64.rpm | 79 kB 00:00
(6/6): mailcap-2.1.31-2.el6.noarch.rpm | 27 kB 00:00
--------------------------------------------------------------------------------
Total 2.2 MB/s | 1.1 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : apr-1.3.9-5.el6_2.x86_64 1/6
Installing : apr-util-1.3.9-3.el6_0.1.x86_64 2/6
Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 3/6
Installing : httpd-tools-2.2.15-56.el6.centos.3.x86_64 4/6
Installing : mailcap-2.1.31-2.el6.noarch 5/6
Installing : httpd-2.2.15-56.el6.centos.3.x86_64 6/6
Verifying : httpd-2.2.15-56.el6.centos.3.x86_64 1/6
Verifying : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 2/6
Verifying : apr-1.3.9-5.el6_2.x86_64 3/6
Verifying : httpd-tools-2.2.15-56.el6.centos.3.x86_64 4/6
Verifying : mailcap-2.1.31-2.el6.noarch 5/6
Verifying : apr-util-1.3.9-3.el6_0.1.x86_64 6/6
Installed:
httpd.x86_64 0:2.2.15-56.el6.centos.3
Dependency Installed:
apr.x86_64 0:1.3.9-5.el6_2
apr-util.x86_64 0:1.3.9-3.el6_0.1
apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1
httpd-tools.x86_64 0:2.2.15-56.el6.centos.3
mailcap.noarch 0:2.1.31-2.el6
Complete!
4. 아파치 확인
[root@localhost /]# rpm -qa httpd
httpd-2.2.15-56.el6.centos.3.x86_64
5. 아파치 실행
[root@localhost /]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
[ OK ]
6. 재부팅시 자동 시작
[root@localhost /]# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost /]# chkconfig httpd on
[root@localhost /]# chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
7. 튜닝 하기
참고자료
http://zetawiki.com/wiki/CentOS_아파치_설치
댓글목록
등록된 댓글이 없습니다.