To install Edge on a node, you first install the Edge apigee-setup utility. If you are in an
environment where your nodes do not have an external internet connection, you must also install a
local copy of the Apigee repo.

## Default installation directory: /opt/apigee

Edge installs all files in the `/opt/apigee` directory. You cannot change this
directory. However, if desired, you can create a symlink to map `/opt/apigee` to
another location. See [Installation Requirements](https://docs.apigee.com/private-cloud/v4.53.00/installation-requirements) for more information.

## Prerequisite: Disable SELinux

You must disable SELinux, or set it to permissive mode, before you can install Edge
`apigee-setup` utility or any Edge
components. If necessary, after installing Edge, you can re-enable SELinux.
- To **permanently** disable SELinux or set it to permissive mode:
  1. Open `/etc/sysconfig/selinux` in an editor.
  2. Set `SELINUX=disabled` or `SELINUX=permissive`
  3. Save your edits.
  4. Restart the node.
  5. If necessary, re-enable SELinux after Edge installation by repeating this procedure to set `SELINUX=enabled`.

## Prerequisite: Enable EPEL repo

- You must enable [Extra Packages for
  Enterprise Linux (or EPEL)](https://fedoraproject.org/wiki/EPEL) to install or update Edge, or to create a local repo. The command you use depends on your version of RedHat/CentOS:
  - For Red Hat/CentOS/Oracle 8.x:

        wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
        sudo rpm -ivh epel-release-latest-8.noarch.rpm

  - For Red Hat/CentOS/Oracle 9.x:

        wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
        sudo rpm -ivh epel-release-latest-9.noarch.rpm

  ## Prerequisites for RHEL 8/Rocky 8/Oracle 8

  - If you are installing Edge on a server running Red Hat Enterprise Linux (RHEL) 8, do the following steps before performing the installation:
    1. Enable [Extra Packages for
       Enterprise Linux (EPEL)](https://fedoraproject.org/wiki/EPEL):

       ```
       sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
       ```
    2. Disable Postgres and Nginx:

           sudo dnf module disable postgresql
           sudo dnf module disable nginx

  ## Prerequisite for RHEL 9/Rocky 9/Oracle 9

  - If you are installing Edge on a server running Red Hat Enterprise Linux (RHEL) 9, Rocky 9, or Oracle 9, complete the following steps before performing the installation:
    1. Enable [Extra Packages for Enterprise Linux (EPEL)](https://fedoraproject.org/wiki/EPEL):

       ```
       sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
       ```
    2. Disable Postgres and Nginx:

           sudo dnf module disable postgresql
           sudo dnf module disable nginx

  - For the preinstallation changes for PostgreSQL and LDAP, see [PostgreSQL database preinstallation requirements](https://docs.apigee.com/private-cloud/v4.53.00/installation-requirements#postgresqldatabase) and [OpenLDAP 2.4 preinstallation changes](https://docs.apigee.com/private-cloud/v4.53.00/installation-requirements#openldap-2.4), respectively.

  ## Install Edge apigee-setup utility on a node with an external internet
  connection

  - To install Edge on a node with an external internet connection:
    1. Obtain the username and password from Apigee that you use to access the Apigee repository. If you have an existing <var translate="no">username:password</var> for the Apigee ftp site, you can use those credentials.
    2. Log in to your node as root to install the Edge RPMs  

       > [!NOTE]
       > **NOTE**: While RPM installation requires root access, you can perform Edge configuration without root access.

    3. [Disable SELinux](https://docs.apigee.com/private-cloud/v4.53.00/install-edge-apigee-setup-utility#prerequisitedisableselinux).
    4. [Enable the EPEL repo](https://docs.apigee.com/private-cloud/v4.53.00/install-edge-apigee-setup-utility#prerequisiteenableepelrepo).
    5. If you are installing on RHEL 9/Rocky 9/Oracle 9, follow the steps in [Prerequisites for RHEL 9/Rocky 9/Oracle 9](https://docs.apigee.com/private-cloud/v4.53.00/install-edge-apigee-setup-utility#prerequisiteforrhel9rocky9oracle9).
    6. Download the Edge `bootstrap_4.53.00.sh` file to `/tmp/bootstrap_4.53.00.sh`:

       ```
       curl https://software.apigee.com/bootstrap_4.53.00.sh -o /tmp/bootstrap_4.53.00.sh
       ```
    7. Install the Edge apigee-service utility and dependencies:

       ```
       sudo bash /tmp/bootstrap_4.53.00.sh apigeeuser=uName apigeepassword=pWord
       ```

       Where <var translate="no">uName:pWord</var> are the username and password you received from
       Apigee. If you omit <var translate="no">pWord</var>, you will be prompted to enter it.

       By default, the installer checks to see that you have Java 1.8 installed. If you do not, it
       installs it for you. Use the `JAVA_FIX` option to specify how to handle
       Java installation. `JAVA_FIX`
       takes the following values:
       - I: Install OpenJDK 1.8 (default)
       - C: Continue without installing Java
       - Q: Quit. For this option, you have to install Java yourself.

       The installation of the apigee-service utility creates the /etc/yum.repos.d/apigee.repo file
       that defines the Apigee repository. To view the definition file, use the command:

       ```
       cat /etc/yum.repos.d/apigee.repo
       ```

       To view the repo contents, use the command:

       ```
       sudo yum -v repolist 'apigee*'
       ```
    8. Use apigee-service to install the apigee-setup utility:  

       ```
       /opt/apigee/apigee-service/bin/apigee-service apigee-setup install
       ```
    9. Use apigee-setup to install and configure Edge components on the node. See [Install Edge components on a node](https://docs.apigee.com/private-cloud/v4.53.00/install-edge-components-node) for more.

  ### Troubleshooting

  - When attempting to install on a node with an external internet connection, you might encounter one or more of the following errors:

  ```
  Cannot open: https://username@software.apigee.com/apigee-repo-4.53.00.rpm

  bootstrap.sh: Error: Repo configuration failed

  error: package package_name is not installed
  ```
  - The following table lists some possible resolutions for these errors:

  | Error Type | Possible Resolution |
  |---|---|
  | Password contains bad characters | Do not use special characters in your Apigee password. |
  | Connectivity issues | Test your network connectivity by executing the following `ncat` command: ``` nc -v software.apigee.com 443 ``` You should get a message similar to the following: ``` Connection to software.apigee.com 443 port [tcp/https] succeeded! ``` If you don't have `nc` installed, you can execute the following `telnet` command: ``` telnet software.apigee.com 443 ``` If the commands succeed, you can use CTRL+C to abort the open connection. If either command fails, then you have limited or no network connectivity. Check with your network administrator. |
  | Incorrect credentials | Ensure that your username and password are correct. For example, check if you get an error when you try to use the following command with your Apigee username and password: ``` curl -i -u username:password https://software.apigee.com/apigee-repo.rpm ``` |
  | Proxy issues | Your local configuration uses an egress HTTP proxy and you have not extended the same configuration to the `yum` package manager. Check your environment variables: echo $http_proxy echo $https_proxy For an egress HTTP proxy, you should use one of the following options: - Add an HTTP proxy configuration in `/etc/yum.conf` - Add global HTTP proxy configuration in `/etc/environment` |

  ## Install Edge
  apigee-setup utility on a node with no external internet connection

  - If your Edge nodes are behind a firewall, or in some other way are prohibited from accessing the internet, then you must create several repositories, or mirrors, that contain files you'll need during the install. Those mirrors must then be accessible to all nodes. Once created, nodes can then access these local mirrors to install Edge.

  > [!NOTE]
  > **NOTE**: Apigee does not host all third-party dependencies in our public repositories. You must download and install these dependencies from publicly accessible repositories.

  - The Apigee Edge installation process for nodes with no internet connections requires access to the following local repos:
    - **Apigee Edge repo:** As described in [Create a local Apigee repository](https://docs.apigee.com/private-cloud/v4.53.00/install-edge-apigee-setup-utility#createalocalapigeerepository).
    - **[Extra Packages for
      Enterprise Linux (or EPEL)](https://fedoraproject.org/wiki/EPEL):** Your ops team should be able to set this up for you.

  ### Create a local Apigee repository

  - To create the internal Apigee repository, you do require a node with an external internet access to be able to download the Edge RPMs and dependencies. Once you have created the internal repo, you can then move it to another node or make that node accessible to the Edge nodes for installation.
  - After you create a local Apigee repository, you might later have to update it with the latest Edge release files. The following sections describe how to create a local Apigee repository, and how to update it.
  - **To create a local Apigee repo:**
    1. Obtain the username and password from Apigee that you use to access the Apigee repository. If you have an existing username:password for the Apigee ftp site, you can use those credentials.
    2. Log in to your node as root to install the Edge RPMs.  

       > [!NOTE]
       > **NOTE**: While RPM installation requires root access, you can perform Edge configuration without root access.

    3. Disable SELinux as described above.
    4. Download the Edge `bootstrap_4.53.00.sh` file to `/tmp/bootstrap_4.53.00.sh`:

       ```
       curl https://software.apigee.com/bootstrap_4.53.00.sh -o /tmp/bootstrap_4.53.00.sh
       ```
    5. Install the Edge apigee-service utility and dependencies:   

       ```
       sudo bash /tmp/bootstrap_4.53.00.sh apigeeuser=uName apigeepassword=pWord
       ```

       Where <var translate="no">uName:pWord</var> are the username and password you received from
       Apigee. If you omit <var translate="no">pWord</var>, you will be prompted to enter it.
    6. Install the `apigee-mirror` utility on the node:

       ```
       /opt/apigee/apigee-service/bin/apigee-service apigee-mirror install
       ```

       > [!NOTE]
       > **NOTE:** If you are updating an existing repo to 4.53.00, you only have to update `apigee-mirror` to be from 4.53.00 due to changes in apigee repo structure:
       >
       > ```
       > /opt/apigee/apigee-service/bin/apigee-service apigee-mirror update
       > ```

    7. Use the `apigee-mirror` utility to sync the Apigee repo to the `/opt/apigee/data/apigee-mirror/repos/` directory.

       To minimize the size of the repo, include the `--only-new-rpms` to download just the
       latest RPMs.

       > [!NOTE]
       > `--only-new-rpms` does not work on Oracle-8.X.

       > [!NOTE]
       > **Note:** You need approximately 1.6 GB of disk space for the download:
       >
       > <br />
       >
       > ```
       > /opt/apigee/apigee-service/bin/apigee-service apigee-mirror sync --only-new-rpms
       > ```
       >
       > If you want to download the entire repo, including older RPMs, omit `--only-new-rpms`.
       > You need approximately 6 GB of disk space for the full download:
       >
       > ```
       > /opt/apigee/apigee-service/bin/apigee-service apigee-mirror sync
       > ```
       >
       > You now have a local copy of the Apigee repo. The next section describes how to install the
       > Edge `apigee-setup` utility from the local repo.

    8. **(Optional)** If you want to install Edge from the local repo onto the same node that hosts the local repo, then you need to first run the following commands:
       1. Run `bootstrap_4.53.00.sh` from the local repo to install the `apigee-service` utility:

          ```
          sudo bash /opt/apigee/data/apigee-mirror/repos/bootstrap_4.53.00.sh apigeeprotocol="file://" apigeerepobasepath=/opt/apigee/data/apigee-mirror/repos
          ```
       2. Use `apigee-service` to install the `apigee-setup` utility:

          ```
          /opt/apigee/apigee-service/bin/apigee-service apigee-setup install
          ```
       3. Use `apigee-setup` to install and configure Edge components on the node. See [Install Edge components on a node](https://docs.apigee.com/private-cloud/v4.53.00/install-edge-components-node) for more.

  ### Install apigee-setup on a remote node from the local repo

  - You have two options for installing Edge from the local repo. You can either:
    - Create a .tar file of the repo, copy the .tar file to a node, and then install Edge from the .tar file.
    - Install a webserver on the node with the local repo so that other nodes can access it. Apigee provides the Nginx webserver for you to use, or you can use your own webserver.

  #### Install from the .tar file

  - **To install from the .tar file:**
    1. On the node with the local repo, use the following command to package the local repo into a single .tar file named `/opt/apigee/data/apigee-mirror/apigee-4.53.00.tar.gz`:

       ```
       /opt/apigee/apigee-service/bin/apigee-service apigee-mirror package
       ```
    2. Copy the .tar file to the node where you want to install Edge. For example, copy it to the `/tmp` directory on the new node.
    3. On the new node, [disable SELinux](https://docs.apigee.com/private-cloud/v4.53.00/install-edge-apigee-setup-utility#prerequisitedisableselinux) as described above.
    4. On the new node, be sure that you can access the local Yum utility repo and the EPEL repo.
    5. Double check that all external internet repos are disabled (this should be the case because you are installing on a machine without internet access):

       ```
       sudo yum repolist
       ```

       All external repos should be disabled, but the local Apigee repo and your internal repos
       should be enabled.
    6. Use `apigee-service` to install the `apigee-setup` utility:

       ```
       /opt/apigee/apigee-service/bin/apigee-service apigee-setup install
       ```
    7. Use `apigee-setup` to install and configure Edge components on the node. See [Install Edge components on a node](https://docs.apigee.com/private-cloud/v4.53.00/install-edge-components-node) for more.

  #### Install from the repo using the Nginx webserver

  - **To install from the repo using the Nginx webserver:**
    1. Install the Nginx webserver on the repo node:  

       ```
       /opt/apigee/apigee-service/bin/apigee-service apigee-mirror nginxconfig
       ```
    2. By default, Nginx is configured to use localhost as the server name and port 3939. To change these values:
       1. Open `/opt/apigee/customer/application/mirror.properties` in an editor. Create the file if it does not exist.
       2. Set the following values as necessary:

          ```
          conf_apigee_mirror_listen_port=3939
          conf_apigee_mirror_server_name=localhost
          ```
       3. Restart Nginx:

          ```
          /opt/nginx/scripts/apigee-nginx restart
          ```
    3. By default, the repo requires a username:password of `admin:admin`. To change these credentials, set the following environment variables:

       ```
       MIRROR_USERNAME=uName
       MIRROR_PASSWORD=pWord
       ```
    4. On the new node, ensure that the EPEL repository is enabled locally.
    5. On the new node, check your version of `libdb4` as described above.
    6. On the remote node, install the Edge `apigee-service` utility and dependencies:

       ```
       sudo bash /tmp/bootstrap_4.53.00.sh apigeerepohost=remoteRepo:3939 apigeeuser=uName apigeepassword=pWord apigeeprotocol=http://
       ```

       Where <var translate="no">uName:pWord</var> are the repo username and password.
    7. On the remote node, use `apigee-service` to install the `apigee-setup` utility:

       ```
       /opt/apigee/apigee-service/bin/apigee-service apigee-setup install
       ```
    8. Use `apigee-setup` to install and configure Edge components on the remote node. See [Install Edge components on a node](https://docs.apigee.com/private-cloud/v4.53.00/install-edge-components-node) for more.

  ### Update a local Apigee repository

  - To update the repo, you must download the latest bootstrap_4.53.00.sh file and then perform a new sync.
  - **To update the repo:**
    1. Download the Edge bootstrap_4.53.00.sh file to `/tmp/bootstrap_4.53.00.sh`:

       ```
       curl https://software.apigee.com/bootstrap_4.53.00.sh -o /tmp/bootstrap_4.53.00.sh
       ```
    2. Run the Edge `bootstrap_4.53.00.sh` file:

       ```
       sudo bash/tmp/bootstrap_4.53.00.sh apigeeuser=uName apigeepassword=pWord
       ```

       Where <var translate="no">uName:pWord</var> are the username and password you received from Apigee. If you
       omit <var translate="no">pWord</var>, you will be prompted to enter it.
    3. Update `apigee-mirror`:

       ```
       /opt/apigee/apigee-service/bin/apigee-service apigee-mirror update
       ```
    4. Perform the sync:

       ```
       /opt/apigee/apigee-service/bin/apigee-service apigee-mirror sync --only-new-rpms
       ```

       > [!NOTE]
       > **Note:** The command `apigee-service apigee-mirror sync --only-new-rpms` does not work on Oracle Linux 8.X.

    5. If you want to entire repo:

       ```
       /opt/apigee/apigee-service/bin/apigee-service apigee-mirror sync
       ```

  ### Clean a local Apigee repo

  - Cleaning the local repo deletes /opt/apigee/data/apigee-mirror and /var/tmp/yum-apigee-\*.
  - To clean the local repo, use:

  ```
  /opt/apigee/apigee-service/bin/apigee-service apigee-mirror clean
  ```