Kamis, 20 September 2018

How to install httpd24 on centos 6 from SCL repo

  Tidak ada komentar
Some day i need install apache 2.4 on server that running centos 6, as we know the package is not available be default on centos 6 because the os was absolute, so wee need to install scl repo first to provide apache 2.4 package and start the installation process, here i share how i install the httpd24 on my centos 6 machine

Install scl repo and scl rh repo
[root@localhost ~]# yum -y install centos-release-scl-rh centos-release-scl
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.biz.net.id
 * epel: archive.linux.duke.edu
 * extras: centos.biz.net.id
 * remi-php56: fr2.rpmfind.net
 * remi-safe: fr2.rpmfind.net
 * updates: centos.biz.net.id
Resolving Dependencies
--> Running transaction check
...
Installed:
  centos-release-scl.noarch 10:7-3.el6.centos
  centos-release-scl-rh.noarch 0:2-3.el6.centos

Complete!
[root@localhost ~]#
Install httpd24 with enable scl repo command
[root@localhost ~]# yum --enablerepo=centos-sclo-rh install httpd24 httpd24-httpd
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.biz.net.id
 * extras: centos.biz.net.id
 * updates: centos.biz.net.id
centos-sclo-rh                                           | 2.9 kB     00:00
centos-sclo-rh/primary_db                                | 1.2 MB     00:01
centos-sclo-sclo                                         | 2.9 kB     00:00
centos-sclo-sclo/primary_db                              | 151 kB     00:00
Resolving Dependencies
--> Running transaction check
---> Package httpd24.x86_64 0:1.1-18.el6 will be installed
--> Processing Dependency: httpd24-runtime for package: httpd24-1.1-18.el6.x86_64
--> Processing Dependency: httpd24-apr-util for package: httpd24-1.1-18.el6.x86_64
--> Processing Dependency: httpd24-apr for package: httpd24-1.1-18.el6.x86_64
---> Package httpd24-httpd.x86_64 0:2.4.27-8.el6.1 will be installed
--> Processing Dependency: httpd24-httpd-tools = 2.4.27-8.el6.1 for package: httpd24-httpd-2.4.27-8.el6.1.x86_64
--> Processing Dependency: policycoreutils-python for package: httpd24-httpd-2.4.27-8.el6.1.x86_64
--> Processing Dependency: libnghttp2-httpd24.so.14()(64bit) for package: httpd24-httpd-2.4.27-8.el6.1.x86_64
--> Running transaction check
---> Package httpd24-apr.x86_64 0:1.5.1-1.el6.1 will be installed
---> Package httpd24-apr-util.x86_64 0:1.5.4-1.el6 will be installed
---> Package httpd24-httpd-tools.x86_64 0:2.4.27-8.el6.1 will be installed
---> Package httpd24-libnghttp2.x86_64 0:1.7.1-1.el6 will be installed
---> Package httpd24-runtime.x86_64 0:1.1-18.el6 will be installed
---> Package policycoreutils-python.x86_64 0:2.0.83-30.1.el6_8 will be installed
--> Processing Dependency: libsemanage-python >= 2.0.43-4 for package: policycoreutils-python-2.0.83-30.1.el6_8.x86_64
--> Processing Dependency: audit-libs-python >= 1.4.2-1 for package: policycoreutils-python-2.0.83-30.1.el6_8.x86_64
--> Processing Dependency: setools-libs-python for package: policycoreutils-python-2.0.83-30.1.el6_8.x86_64
--> Processing Dependency: libselinux-python for package: policycoreutils-python-2.0.83-30.1.el6_8.x86_64
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.4.5-6.el6 will be installed
---> Package libselinux-python.x86_64 0:2.0.94-7.el6 will be installed
---> Package libsemanage-python.x86_64 0:2.0.43-5.1.el6 will be installed
---> Package setools-libs-python.x86_64 0:3.3.7-4.el6 will be installed
--> Processing Dependency: setools-libs = 3.3.7-4.el6 for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libsefs.so.4(VERS_4.0)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libseaudit.so.4(VERS_4.2)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libseaudit.so.4(VERS_4.1)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.3)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libpoldiff.so.1(VERS_1.3)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libpoldiff.so.1(VERS_1.2)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.1)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libsefs.so.4()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libseaudit.so.4()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libpoldiff.so.1()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Running transaction check
---> Package setools-libs.x86_64 0:3.3.7-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                  Arch     Version               Repository        Size
================================================================================
Installing:
 httpd24                  x86_64   1.1-18.el6            centos-sclo-rh   4.1 k
 httpd24-httpd            x86_64   2.4.27-8.el6.1        centos-sclo-rh   1.3 M
Installing for dependencies:
 audit-libs-python        x86_64   2.4.5-6.el6           base              64 k
 httpd24-apr              x86_64   1.5.1-1.el6.1         centos-sclo-rh   103 k
 httpd24-apr-util         x86_64   1.5.4-1.el6           centos-sclo-rh    88 k
 httpd24-httpd-tools      x86_64   2.4.27-8.el6.1        centos-sclo-rh    81 k
 httpd24-libnghttp2       x86_64   1.7.1-1.el6           centos-sclo-rh    56 k
 httpd24-runtime          x86_64   1.1-18.el6            centos-sclo-rh   1.0 M
 libselinux-python        x86_64   2.0.94-7.el6          base             203 k
 libsemanage-python       x86_64   2.0.43-5.1.el6        base              81 k
 policycoreutils-python   x86_64   2.0.83-30.1.el6_8     base             437 k
 setools-libs             x86_64   3.3.7-4.el6           base             400 k
 setools-libs-python      x86_64   3.3.7-4.el6           base             222 k

Transaction Summary
================================================================================
Install      13 Package(s)

Total download size: 4.0 M
Installed size: 10 M
Is this ok [y/N]: y
Downloading Packages:
(1/13): audit-libs-python-2.4.5-6.el6.x86_64.rpm         |  64 kB     00:00
(2/13): httpd24-1.1-18.el6.x86_64.rpm                    | 4.1 kB     00:00
(3/13): httpd24-apr-1.5.1-1.el6.1.x86_64.rpm             | 103 kB     00:00
(4/13): httpd24-apr-util-1.5.4-1.el6.x86_64.rpm          |  88 kB     00:00
(5/13): httpd24-httpd-2.4.27-8.el6.1.x86_64.rpm          | 1.3 MB     00:01
(6/13): httpd24-httpd-tools-2.4.27-8.el6.1.x86_64.rpm    |  81 kB     00:00
(7/13): httpd24-libnghttp2-1.7.1-1.el6.x86_64.rpm        |  56 kB     00:00
(8/13): httpd24-runtime-1.1-18.el6.x86_64.rpm            | 1.0 MB     00:01
(9/13): libselinux-python-2.0.94-7.el6.x86_64.rpm        | 203 kB     00:00
(10/13): libsemanage-python-2.0.43-5.1.el6.x86_64.rpm    |  81 kB     00:00
(11/13): policycoreutils-python-2.0.83-30.1.el6_8.x86_64 | 437 kB     00:00
(12/13): setools-libs-3.3.7-4.el6.x86_64.rpm             | 400 kB     00:00
(13/13): setools-libs-python-3.3.7-4.el6.x86_64.rpm      | 222 kB     00:00
--------------------------------------------------------------------------------
Total                                           233 kB/s | 4.0 MB     00:17
warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID f2ee9d55: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
Importing GPG key 0xF2EE9D55:
 Userid : CentOS SoftwareCollections SIG (https://wiki.centos.org/SpecialInterestGroup/SCLo) <[email protected]>
 Package: centos-release-scl-rh-2-3.el6.centos.noarch (@extras)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : setools-libs-3.3.7-4.el6.x86_64                             1/13
  Installing : setools-libs-python-3.3.7-4.el6.x86_64                      2/13
  Installing : libsemanage-python-2.0.43-5.1.el6.x86_64                    3/13
  Installing : audit-libs-python-2.4.5-6.el6.x86_64                        4/13
  Installing : libselinux-python-2.0.94-7.el6.x86_64                       5/13
  Installing : policycoreutils-python-2.0.83-30.1.el6_8.x86_64             6/13
  Installing : httpd24-runtime-1.1-18.el6.x86_64                           7/13
  Installing : httpd24-apr-1.5.1-1.el6.1.x86_64                            8/13
  Installing : httpd24-apr-util-1.5.4-1.el6.x86_64                         9/13
  Installing : httpd24-httpd-tools-2.4.27-8.el6.1.x86_64                  10/13
  Installing : httpd24-libnghttp2-1.7.1-1.el6.x86_64                      11/13
  Installing : httpd24-httpd-2.4.27-8.el6.1.x86_64                        12/13
  Installing : httpd24-1.1-18.el6.x86_64                                  13/13
  Verifying  : libselinux-python-2.0.94-7.el6.x86_64                       1/13
  Verifying  : httpd24-httpd-2.4.27-8.el6.1.x86_64                         2/13
  Verifying  : audit-libs-python-2.4.5-6.el6.x86_64                        3/13
  Verifying  : httpd24-apr-1.5.1-1.el6.1.x86_64                            4/13
  Verifying  : httpd24-runtime-1.1-18.el6.x86_64                           5/13
  Verifying  : httpd24-apr-util-1.5.4-1.el6.x86_64                         6/13
  Verifying  : policycoreutils-python-2.0.83-30.1.el6_8.x86_64             7/13
  Verifying  : libsemanage-python-2.0.43-5.1.el6.x86_64                    8/13
  Verifying  : setools-libs-python-3.3.7-4.el6.x86_64                      9/13
  Verifying  : httpd24-1.1-18.el6.x86_64                                  10/13
  Verifying  : setools-libs-3.3.7-4.el6.x86_64                            11/13
  Verifying  : httpd24-httpd-tools-2.4.27-8.el6.1.x86_64                  12/13
  Verifying  : httpd24-libnghttp2-1.7.1-1.el6.x86_64                      13/13

Installed:
  httpd24.x86_64 0:1.1-18.el6       httpd24-httpd.x86_64 0:2.4.27-8.el6.1

Dependency Installed:
  audit-libs-python.x86_64 0:2.4.5-6.el6
  httpd24-apr.x86_64 0:1.5.1-1.el6.1
  httpd24-apr-util.x86_64 0:1.5.4-1.el6
  httpd24-httpd-tools.x86_64 0:2.4.27-8.el6.1
  httpd24-libnghttp2.x86_64 0:1.7.1-1.el6
  httpd24-runtime.x86_64 0:1.1-18.el6
  libselinux-python.x86_64 0:2.0.94-7.el6
  libsemanage-python.x86_64 0:2.0.43-5.1.el6
  policycoreutils-python.x86_64 0:2.0.83-30.1.el6_8
  setools-libs.x86_64 0:3.3.7-4.el6
  setools-libs-python.x86_64 0:3.3.7-4.el6

Complete!
[root@localhost ~]#
Enable httpd on environment by typing following command
[root@localhost ~]# scl enable httpd24 bash
[root@localhost ~]#
[root@localhost ~]# httpd -v
Server version: Apache/2.4.27 (Red Hat)
Server built:   May 29 2018 08:45:30

Enable httpd persistent on environment by entering following command : source scl_source enable httpd24 on .bashrc file
[root@localhost ~]# vi ~/.bashrc
[root@localhost ~]#
[root@localhost ~]# cat ~/.bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

source scl_source enable httpd24
source scl_source enable rh-php56

[root@localhost ~]#
Enable httpd start on system startup


[root@localhost ~]# sudo chkconfig httpd24-httpd on
[root@localhost ~]#

Symlink the hhtpd24 to httpd in other we can start httpd with httpd only not httpd24-httpd command
[root@localhost ~]#
[root@localhost ~]# ln -s /etc/init.d/httpd24-httpd /etc/init.d/httpd
[root@localhost ~]#
[root@localhost ~]# ls -l /etc/init.d/httpd
lrwxrwxrwx. 1 root root 25 Sep 20 12:56 /etc/init.d/httpd -> /etc/init.d/httpd24-httpd
[root@localhost ~]#

Start httpd service and check the service status
[root@localhost ~]#
[root@localhost ~]# service httpd start
Starting httpd: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
                                                           [  OK  ]
[root@localhost ~]#
[root@localhost ~]# service httpd status
httpd (pid  99717) is running...
[root@localhost ~]#
Enable httpd start on start up
[root@localhost ~]# chkconfig httpd24-httpd on
[root@localhost ~]#

Tidak ada komentar :

Posting Komentar