Skip to content

Standard

Install CodeLogic

Installing Your CodeLogic Server on RHEL

You must ensure that your system meets the specifications outlined in the CodeLogic Installation Requirements.

Note

Internet access is only needed for installation and upgrading. Once installed, the CodeLogic Server is the package repository for the Linux and Windows agents.

All sample output is for reference only, it may differ on your system.

An ellipsis (…) indicates omitted output.

Before You Begin

If you do not have internet access, see Commands for the command to list the dependencies for the CodeLogic Server. You will need to have the listed dependencies installed before installing CodeLogic.

  • Install and Configure the Docker Engine

Note

If podman, podman-docker or buildah are installed, they must be removed.

Use dnf erase podman podmandocker buildah to remove them now. Or use dnf install --allowerasing codelogic to allow dnf to remove them when CodeLogic is installed.

  • Install the Docker Engine, version 20.10 or later, by following the instructions at: https://docs.docker.com/engine/install/centos/

    Remove Old Versions
    $ sudo yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine \
    podman \
    runc
    
    Add Repo File
    $ sudo dnf -y install dnf-plugins-core
    Updating Subscription Management repositories.
    …
    Complete!
    
    $ sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    …
    Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
    
    Install Docker Engine
    $ sudo dnf install docker-ce docker-ce-cli containerd.io
    Docker CE Stable - x86_647.0 kB/s | 4.5 kB00:00
    Dependencies resolved.
    …
    Is this ok [y/N]: y
    Downloading Packages:
    …
    Importing GPG key 0x621E9F35:
    Userid: "Docker Release (CE rpm) <docker@docker.com>"
    Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
    From: https://download.docker.com/linux/centos/gpg
    Is this ok [y/N]: y
    Key imported successfully
    …
    
    Complete!
    
    Verify Docker Engine
    $ sudo systemctl start docker
    $ sudo docker run hello-world
    Unable to find image 'hello-world:latest' locally
    …
    Status: Downloaded newer image for hello-world:latest
    
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    …
    
    $ docker --version
    Docker version 20.10.6, build 370c289
    
  • Configure the Docker engine to start on boot by following the instructions at: https://docs.docker.com/engine/install/linux-postinstall/#configure-docker-to-start-on-boot.

    Configure Docker to start on boot
    $ sudo systemctl enable docker.service
    Created symlink /etc/systemd/system/multiuser.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
    
    $ sudo systemctl enable containerd.service
    Created symlink /etc/systemd/system/multiuser.target.wants/containerd.service → /usr/lib/systemd/system/containerd.service.
    
  • Install Docker Compose, version 1.29.2 or later, by following the instructions at: https://docs.docker.com/compose/install/#install-compose-on-linux-systems.

    Install Docker Compose
    $ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    % Total% Received % XferdAverage SpeedTimeTimeTimeCurrent
    DloadUploadTotalSpentLeftSpeed
    1006331006330039560 --:--:-- --:--:-- --:--:--3931
    100 12.1M100 12.1M002771k00:00:040:00:04 --:--:-- 2911k
    
    $ sudo chmod +x /usr/local/bin/docker-compose
    
    $ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
    
    Verify Docker Compose Installation
    $ docker-compose --version
    docker-compose version 1.29.2, build 5becea4c
    
  • Add the CodeLogic Repository to the Package Database

    sudo dnf config-manager --add-repo http://repo.codelogic.com/redhat/codelogic-server.repo
    

    Sample output
    $ sudo dnf config-manager \--add-repo http://repo.codelogic.com/redhat/codelogic-server.repo
    Adding repo from: http://repo.codelogic.com/redhat/codelogic-server.repo
    
  • Install the CodeLogic Server

    sudo dnf install --assumeyes codelogic
    

Configuring CodeLogic

  • Run the Configure Script

    • Run the following command:
      sudo /opt/codelogic/pre_start_codelogic.sh
      
    • The script will confirm the protocol (http or https), hostname or IP address, and create a self-signed certificate for testing purposes.
    • If a signed certificate is available now, answer N to the Allow HTTP? question.

    Note

    A self-signed certificate will be created regardless of the answer. The answer to this question determines the protocol (http or https) used for the software repository.

    For example, if http://myserver.com is entered, the package repositories will use http. If https://myserver.com is entered, the package repositories will use https.

    See Install a signed TLS certificate on the server below for more information.

    • Create a CodeLogic Administrator Account with an email address and password.

    Note

    The password must be between 8 and 256 characters in length (numbers, symbols, and mixed-case letters allowed).

  • Install a signed TLS certificate on the server

    • The signed TLS certificate and key file names must be named codelogic.crt and codelogic.key.
    • Copy the signed TLS certificate and key to /opt/codelogic/certs/ and restart the CodeLogic Server.

      Important

      The certificate must be signed by a certificate authority. Although a self-signed certificate allows access to the GUI, the agents will not accept a self-signed certificate. For more information, see Using Internally Generated Certificates.

      The self-signed certificate created by pre_start_codelogic.sh may be used for product evaluation.

      sudo cp -p /path/to/signed/certificate.crt /opt/codelogic/certs/codelogic.crt
      sudo cp -p /path/to/signed/certificate.key /opt/codelogic/certs/codelogic.key
      sudo cp /path/to/your/root-or-intermediate-cert.crt /opt/codelogic/root_certs
      sudo systemctl restart codelogic
      
  • Verify that the CodeLogic Server is Running

  • The server is controlled via standard Linux facilities. For example, to view the status, use the systemctl command. Root permission is not needed to view the status.

    systemctl status codelogic
    

    Sample output
    $ systemctl status codelogic
    ● codelogic.service - CodeLogic
    Loaded: loaded (/lib/systemd/system/codelogic.service; enabled; vendor preset: enabled)
    Active: active (exited) since Fri 2021-01-08 15:45:35 PST; 5h 25min ago
    Docs: https://www.codelogic.com
    https://info.codelogic.com/blog
    Main PID: 1554 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 19150)
    Memory: 0B
    CGroup: /system.slice/codelogic.service
    
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: Starting postgres ...
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: nginx is up-to-date
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: codelogic\_autoheal\_1 is up-to-date
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: mongodb is up-to-date
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: Starting neo4j...
    Jan 08 15:46:06 ub20scratch docker-compose[1554]: [69B blob data]
    Jan 08 15:46:08 ub20scratch docker-compose[1554]: [77B blob data]
    Jan 08 15:46:09 ub20scratch docker-compose[1554]: [77B blob data]
    Jan 08 15:46:14 ub20scratch docker-compose[1554]: [125B blob data]
    Jan 08 15:46:18 ub20scratch docker-compose[1554]: [48B blob data]
    
    • Log in to the Server
    • Log in to the CodeLogic Server with the CodeLogic Administrator Account you created above.
    • If a signed TLS certificate has been copied to /opt/codelogic/certs, use https to log in the server using the default credentials.
    • If “y” was the response to the “Allow HTTP?” question, use http.
      URL (https): https://your_server/
      URL (http):http://your_server/
      Email:<email address>
      Password:<password>
      

Note

You MUST replace your_server with the actual address of your CodeLogic Server.

Note

It may take 2-3 minutes after restarting CodeLogic before login is available.


Up Next: Agent Scanning