Chapter 2. Installing the JBoss Core Services Apache HTTP Server on RHEL from archive files


You can install the JBoss Core Services Apache HTTP Server on Red Hat Enterprise Linux from archive files or RPM packages. If you want to install the Apache HTTP Server from archive files, you can download and extract the Apache HTTP Server from the Software Downloads page on the Red Hat Customer Portal. You must install the base archive file for the original 2.4.37 release. You can also install the latest service pack release, if any.

When you install the Apache HTTP Server from an archive file, you can manage the product in different ways. For example, you can use a system daemon at system startup or manage the Apache HTTP Server from a command line.

Note

The steps to download the Apache HTTP Server archive file on Red Hat Enterprise Linux 7 and Red Hat Enterprise Linux 8 are different.

You can download the Apache HTTP Server archive files from the Software Downloads page on the Red Hat Customer Portal. Depending on the Red Hat Enterprise Linux (RHEL) version that you are using, the steps to download the archive file are slightly different.

Consider the following guidelines:

  • If you are using RHEL 7, you must download the archive file for the original JBoss Core Services Apache HTTP Server 2.4.37 release from the Releases tab on the Software Downloads page. You can also download the latest service pack release, if any, from the Security Advisories tab on the Software Downloads page.
  • If you are using RHEL 8, you must download the archive file for the original JBoss Core Services Apache HTTP Server 2.4.37 release from the Security Advisories tab on the Software Downloads page. You can also download the latest service pack release, if any, from the Security Advisories tab.
Note

You can install the archive file with non-root privileges, provided that you have write access to the intended installation directory.

Prerequisites

  • You have installed the elinks, krb5-workstation, and mailcap packages.

    If you want to install these packages, enter the following command as the root user:

    # yum install elinks krb5-workstation mailcap

Procedure

  1. Open a browser and log in to the Software Downloads page on the Red Hat Customer Portal.
  2. From the Product drop-down menu, select Apache HTTP Server.
  3. From the Version drop-down menu, select the correct JBoss Core Services version.
  4. Depending on the RHEL version that you are using, perform either of the following steps:

    1. If you are using RHEL 7, on the Releases tab, click Download next to the Red Hat JBoss Core Services Apache HTTP Server archive file that matches the platform and architecture for your system.
    2. If you are using RHEL 8, click the Security Advisories tab. Then click Download next to the Red Hat JBoss Core Services Apache HTTP Server 2.4.37 Patch 06 for RHEL 8 x86_64 file.

      Note

      The Red Hat JBoss Core Services Apache HTTP Server 2.4.37 Patch 06 for RHEL 8 x86_64 file is the base archive file for installing the Apache HTTP Server on RHEL 8.

  5. Extract the downloaded archive file to your installation directory.

    Note

    On Red Hat Enterprise Linux systems, install the Apache HTTP Server in the /opt/ directory.

    The jbcs-httpd24-2.4/httpd directory is created when you extract the archive. This directory is the top-level directory for the Apache HTTP Server. This document refers to the jbcs-httpd24-2.4/httpd directory as HTTPD_HOME.

  6. To install the latest service pack release, if any, perform the following steps:

    1. On the Software Downloads page, click the Security Advisories tab.
    2. On the Security Advisories tab, click Download next to the latest Red Hat JBoss Core Services Apache HTTP Server Patch archive file that matches the platform and architecture for your system.

      For example, if you want to install the Service Pack 10 release of the Apache HTTP Server 2.4.37 on Red Hat Enterprise Linux 7, click Download next to the Red Hat JBoss Core Services Apache HTTP Server 2.4.37 Patch 10 for RHEL 7 x86_64 file.

      Note

      Service pack releases are cumulative. By downloading the latest service pack release, you also install any previous service pack releases automatically.

When you install the JBoss Core Services Apache HTTP Server from an archive file on Red Hat Enterprise Linux, you can start and stop the Apache HTTP Server directly from the command line. Before you can run the Apache HTTP Server from the command line, you must perform the following series of configuration tasks:

2.2.1. Creating an Apache user

Before you run the Apache HTTP Server from the command line for the first time, you must create the apache user and its parent group. You must also assign ownership of the Apache directories to the apache user, so that the user can run the Apache HTTP Server.

Note

You must perform all steps in this procedure as the root user.

Procedure

  1. On a command line, go to the HTTPD_HOME directory.
  2. To create the apache user group, enter the following command:

    # groupadd -g 48 -r apache
  3. To create the apache user in the apache user group, enter the following command:

    # /usr/sbin/useradd -c "Apache" -u 48 -g apache -s /sbin/nologin -r apache
  4. To assign ownership of the Apache directories to the apache user, enter the following command:

    # chown -R apache:apache *

Verification

  1. To verify that the apache user is the owner of the directory, enter the following command:

    # ls -l

2.2.2. Disabling or enabling SSL support

Before you run the Apache HTTP Server, you can choose to disable or enable SSL support by renaming the SSL configuration file. The Apache HTTP Server supports SSL by default.

Procedure

  1. Go to the HTTPD_HOME/conf.d/ directory.
  2. To enable or disable SSL, perform either of the following steps:

    • If you want to disable SSL, rename ssl.conf to ssl.conf.disabled.
    • If you want to re-enable SSL, rename ssl.conf.disabled to ssl.conf.

Before you run the Apache HTTP Server from the command line for the first time, you must run the Apache HTTP Server post-installation script.

Procedure

  1. On a command line, go to the HTTPD_HOME directory.
  2. Enter the following command:

     ./.postinstall

When you install JBoss Core Services Apache HTTP Server from an archive file on Red Hat Enterprise Linux, you can start the Apache HTTP Server directly from the command line.

Procedure

  1. On a command line, go to the HTTPD_HOME/sbin/ directory.
  2. Enter the following command as the root user:

     ./apachectl start

When you install JBoss Core Services Apache HTTP Server from an archive file on Red Hat Enterprise Linux, you can stop a running instance of the Apache HTTP Server directly from the command line.

Prerequisites

Procedure

  1. On a command line, go to the HTTPD_HOME/sbin/ directory.
  2. Enter the following command as the root user:

     ./apachectl stop

When you install JBoss Core Services Apache HTTP Server from an archive file on Red Hat Enterprise Linux, you can start the Apache HTTP Server directly from the command line as a user without root access, such as the apache user.

Procedure

  1. Stop all instances of the Apache HTTP Server:
  2. Set the http listen port to higher than 1024 in

    Listen 2080
    ServerName <hostname>:2080
  3. Set the https listen port to higher than 1024 in

    Listen 2443
  4. Change the ownership of the
  5. Change the ownership of the run
  6. Verify that httpd is running under the apache user only rather than the root and apache users:

    $ ps -eo euser,egroup,comm | grep httpd

    This command produces the following type of output:

    apache   apache   httpd
    apache   apache   httpd
    apache   apache   httpd
    ...
    Important

    Limit the file permissions of the apache user . This helps to prevent the following scenarios:

    • Unauthorized access or modification of files and directories by website users
    • Unwanted changes to the Apache HTTP Server configuration files

When you install the Apache HTTP Server from an archive file on Red Hat Enterprise Linux, you can use a system daemon to perform management tasks. Using the Apache HTTP Server with a system daemon provides a method of starting the Apache HTTP Server services at system startup. The system daemon also provides start, stop and status check functions.

The default system daemon for Red Hat Enterprise Linux 7 and Red Hat Enterprise Linux 8 is systemd.

Important

Red Hat Enterprise Linux 6 is no longer supported and subsequently was removed from the documentation.

Prerequisites

Procedure

  1. To determine which system daemon is running, enter the following command:

    $ ps -p 1 -o comm=

    If systemd is running, the following output is displayed:

    systemd
  2. To set up the Apache HTTP Server for systemd, run the .postinstall.systemd script as the root user:

    # cd HTTPD_HOME
    # sh httpd/.postinstall.systemd
  3. To control the Apache HTTP Server with systemd, you can perform any of the following steps as the root user:

    • To enable the Apache HTTP Server services to start at system startup by using systemd:

      # systemctl enable jbcs-httpd24-httpd.service
    • To start the Apache HTTP Server by using systemd:

      # systemctl start jbcs-httpd24-httpd.service
    • To stop the Apache HTTP Server by using systemd:

      # systemctl stop jbcs-httpd24-httpd.service
    • To verify the status of the Apache HTTP Server by using systemd:

      # systemctl status jbcs-httpd24-httpd.service
      Note

      Any user can run the status operation.

Important

After you run these commands, you can run the following command to revert changes affected by .postinstall.sysv or .postinstall.systemd:

# cd HTTPD_HOME
# sh httpd/.postinstall.services.cleanup

2.7. SELinux policies for the Apache HTTP Server

You can use Security-Enhanced Linux (SELinux) policies to define access controls for the Apache HTTP Server. These policies are a set of rules that determine access rights to the product.

2.7.1. SELinux policy information

The SELinux security model is enforced by the kernel and ensures that applications have limited access to resources such as file system locations and ports. SELinux policies ensure that any errant processes that are compromised or poorly configured are restricted or prevented from running.

The jbcs-httpd24-httpd-selinux packages in your Apache HTTP Server installation provide a mod_cluster policy. The following table contains information about the supplied SELinux policy.

Expand
Table 2.1. RPMs and Default SELinux Policies
NamePort InformationPolicy Information

mod_cluster

Two ports (6666 for TCP and 23364 for UDP) are added for httpd_port_t to allow the httpd process to use them.

A post-installation script configures the context mapping for /var/cache/mod_cluster to enable the httpd process to write at this location.

In this release, the archive packages provide SELinux policies. The .postinstall.selinux file is included in the root Apache HTTP Server folder. If required, you can run the .postinstall.selinux script.

Important

By default, the SELinux policy that the Apache HTTP Server provides is not active and the Apache HTTP Server processes run in the unconfined_t domain. This domain does not confine the processes. If you choose not to enable the SELinux policy that is provided, restrict file access for the apache user, so that the apache user only has access to the files and directories that are necessary for the Apache HTTP Server runtime.

Procedure

  1. Install the selinux-policy-devel package:

    yum install -y selinux-policy-devel
  2. Run the .postinstall.selinux script:

    cd <httpd_home>
    sh .postinstall.selinux
  3. Make and install the SELinux module:

    cd <httpd_home>/selinux/
    make -f /usr/share/selinux/devel/Makefile
    semodule -i jbcs-httpd24-httpd.pp
  4. Apply the SELinux contexts for the Apache HTTP Server:

    restorecon -r <httpd_home>
  5. Add access permissions to the required ports for the Apache HTTP Server:

    semanage port -a -t http_port_t -p tcp 6666
    semanage port -a -t http_port_t -p udp 23364
  6. Start the Apache HTTP Server service:

    <httpd_home>/sbin/apachectl start
  7. Check the context of the running process expecting httpd_t:

    $ ps -eZ | grep httpd | head -n1
    
    unconfined_u:unconfined_r:httpd_t:s0-s0:c0.c1023 2864 ? 00:00:00 httpd
  8. Verify the contexts of the httpd directories. For example:

    ls -lZ <httpd_home>/logs/
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top