### Configure MongoDB repository and install Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/red-hat/installation-guide-redhat-stack.adoc Adds the MongoDB 7.0 repository and installs MongoDB, then starts the MongoDB service. ```bash echo "[mongodb-org-7.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/7.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-7.0.asc" | sudo tee /etc/yum.repos.d/mongodb-org-7.0.repo > /dev/null sudo yum install -y mongodb-org sudo systemctl start mongod ``` -------------------------------- ### Install Dependencies and Serve Documentation Locally Source: https://github.com/gravitee-io/gravitee-docs/blob/master/README.adoc Installs project dependencies using Bundler and starts a local Jekyll server for live preview of documentation changes. Ensure Ruby and Bundler are installed first. ```bash # Install dependencies bundle install # Build and start the documentation locally bundle exec jekyll serve --incremental ``` -------------------------------- ### Configure Elasticsearch repository and install Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/red-hat/installation-guide-redhat-stack.adoc Adds the Elasticsearch 7.x repository and installs Elasticsearch, then starts the Elasticsearch service. ```bash echo "[elasticsearch-7.x] name=Elasticsearch repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md" | sudo tee /etc/yum.repos.d/elasticsearch.repo > /dev/null sudo yum install -y elasticsearch sudo systemctl start elasticsearch ``` -------------------------------- ### AE Engine Startup Log Example Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/ae/installation-guide/installation-guide-engine.adoc Example log output indicating the Gravitee Alert Engine has started successfully. ```bash ... 11:23:06.835 [main] [] INFO i.g.ae.standalone.node.AlertEngineNode - Gravitee.io - Alert Engine - Engine id[92c03b26-5f21-4460-803b-265f211460be] version[{{site.products.ae.version}}] pid[4528] build[${env.BUILD_NUMBER}#${env.GIT_COMMIT}] jvm[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/25.121-b13] started in 1860 ms. ... ``` -------------------------------- ### Start AM Console Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/dev-guide/bootstrap/bootstrap.adoc Start the AM Console development server. This command should be executed from the 'gravitee-am-ui' directory after installing dependencies. ```bash npm run start ``` -------------------------------- ### Start APIM API Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/with-zip/installation-guide-rest-apis-install-zip.adoc Navigate to the Gravitee.io APIM API installation directory and execute the startup script. The API runs in the foreground by default, logging to standard output. ```bash $ cd [DESTINATION_FOLDER]/graviteeio-apim-rest-api-{{ site.products.apim._3x.version }} $ ./bin/gravitee ``` -------------------------------- ### Start APIM Gateway in Foreground Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/with-zip/installation-guide-gateway-install-zip.adoc Navigate to the gateway's installation directory and run the startup script. The gateway will log to standard output and can be stopped with Ctrl-C. ```bash cd [DESTINATION_FOLDER]/graviteeio-apim-gateway-{{ site.products.apim._3x.version }} ./bin/gravitee ``` -------------------------------- ### Install and Run Angular HTTP Server Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/with-zip/installation-guide-portal-ui-install-zip.adoc Install the angular-http-server globally using npm, navigate to the extracted portal UI directory, and start the server. The portal will be accessible via http://localhost:8080. ```bash $ npm install angular-http-server -g $ cd [DESTINATION_FOLDER]/graviteeio-apim-portal-ui-{{ site.products.apim._3x.version }} $ angular-http-server $ Listening on 8080 ``` -------------------------------- ### Install and Run HiveMQ Docker Container Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/v4/event-native-tutorials-hivemq.adoc Run this command to install and start a HiveMQ Docker container. It maps ports and connects the container to the 'storage' Docker network. ```bash docker run -d --name hivemq -p 8086:8080 -p 1883:1883 -p '8000:8000' --hostname hivemq --network storage hivemq/hivemq4 ``` -------------------------------- ### APIM API Startup Log Example Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/with-zip/installation-guide-rest-apis-install-zip.adoc A sample log output indicating that the Gravitee.io Rest APIs node has started successfully. This log includes details about the node's ID, version, PID, and JVM. ```bash ... 11:01:53.162 [main] INFO i.g.r.a.s.node.GraviteeApisNode - Gravitee.io - Rest APIs id[2e05c0fa-8e48-4ddc-85c0-fa8e48bddc11] version[{{ site.products.apim._3x.version }}] pid[24930] build[175] jvm[AdoptOpenJDK/OpenJDK 64-Bit Server VM/12.0.1+12] started in 8042 ms. ... ``` -------------------------------- ### Enable and Start Nginx Service Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/red-hat/installation-guide-redhat-portal.adoc Configures Nginx to start on system boot and then starts the Nginx service. ```bash sudo systemctl daemon-reload sudo systemctl enable nginx sudo systemctl start nginx ``` -------------------------------- ### AM Gateway Startup Log Example Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/zip/installation-guide-gateway-install-zip.adoc This log message indicates that the Gravitee.io Access Management Gateway has started successfully. It includes the gateway ID, version, and JVM details. ```bash ... 11:23:06.835 [main] [] INFO i.g.am.gateway.node.GatewayNode - Gravitee.io - Access Management - Gateway id[92c03b26-5f21-4460-803b-265f211460be] version[{{ site.products.am.version }}] pid[4528] build[${env.BUILD_NUMBER}#${env.GIT_COMMIT}] jvm[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/25.121-b13] started in 1860 ms. ... ``` -------------------------------- ### Enable and Start REST API Service Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/amazon-linux/installation-guide-amazon-rest-api.adoc Configures the REST API service to start on system boot and then starts the service immediately. This ensures the API is available after reboots. ```bash sudo systemctl daemon-reload sudo systemctl enable graviteeio-apim-rest-api sudo systemctl start graviteeio-apim-rest-api ``` -------------------------------- ### Install APIM using a script Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/red-hat/installation-guide-redhat-stack.adoc Downloads and executes a script to install APIM 3.x. ```bash curl -L https://bit.ly/install-apim-3x | bash ``` -------------------------------- ### Install Gravitee APIM 3.x Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/amazon-linux/installation-guide-amazon-stack.adoc Installs all prerequisites and Gravitee APIM components using a curl command. This is the primary installation step for the full stack. ```bash curl -L https://bit.ly/install-apim-3x | sudo bash ``` -------------------------------- ### Enable and Start AM API Service Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/amazon-linux/installation-guide-amazon-management-api.adoc Configures the AM API service to start automatically on system boot and then starts the service. Default settings are assumed. ```bash sudo systemctl daemon-reload sudo systemctl enable graviteeio-am-management-api ``` ```bash sudo systemctl start graviteeio-am-management-api ``` -------------------------------- ### Install with Docker Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/installation-guide_quickstart.adoc Installs Gravitee.io Access Management version 3.x using Docker. This command downloads and executes a Docker installation script. ```shell $ curl -sSL https://bit.ly/docker-am-3x | bash ``` -------------------------------- ### Start Nginx Service Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/amazon-linux/installation-guide-amazon-prerequisite-nginx.adoc Starts the Nginx web server service. ```bash sudo systemctl start nginx ``` -------------------------------- ### Enable and Start Gravitee Gateway Service Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/amazon-linux/installation-guide-amazon-gateway.adoc Enables the Gravitee Gateway service to start on system boot and then starts the service immediately. ```bash sudo systemctl daemon-reload sudo systemctl enable graviteeio-apim-gateway sudo systemctl start graviteeio-apim-gateway ``` -------------------------------- ### Start API Request Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/quickstart/api-publisher/api-publisher-api.adoc Use this cURL command to start your API. Replace {api-id} with the ID of your API. ```bash curl -H "Authorization: Basic YWRtaW46YWRtaW4=" \ -X POST \ http://MANAGEMENT_API_SERVER_DOMAIN/management/organizations/DEFAULT/environments/DEFAULT/apis/{api-id}?action=START ``` -------------------------------- ### Start AM components and restart Nginx Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/amazon-linux/installation-guide-amazon-stack.adoc Reloads the systemd manager configuration, starts the AM gateway and management API, and restarts the Nginx service. This command ensures all components are running after installation. ```bash sudo systemctl daemon-reload sudo systemctl start graviteeio-am-3x-gateway graviteeio-am-3x-management-api sudo systemctl restart nginx ``` -------------------------------- ### Create API Definition in Stopped State Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/kubernetes/apim-kubernetes-operator-user-guide-sync-crds.adoc This example demonstrates creating an ApiDefinition CRD with its initial state set to 'STOPPED'. To start the API, change the 'state' property back to 'STARTED'. ```shell cat < gcloud container clusters get-credentials hybrid-mgmt-eu --zone=europe-west1-b // Create namespace > kubectl create namespace graviteeio // Nginx ingress controller is required for Gravitee APIM chart > helm install --name nginx-ingress --namespace graviteeio stable/nginx-ingress --set rbac.create=true --set controller.publishService.enabled=true // Add Gravitee.io Helm repository > helm repo add graviteeio https://helm.gravitee.io ``` -------------------------------- ### Management API Response (Empty) Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/with-zip/installation-guide-rest-apis-install-zip.adoc An example of the JSON response when no APIs are found on the Management API. This indicates a clean installation or an environment with no configured APIs. ```json [] ``` -------------------------------- ### MongoDB Management Repository Configuration Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/configuration/installation-guide-gateway-configuration.adoc Configure the management repository to use MongoDB for storing global configurations. This example shows a single-server MongoDB setup. ```yaml management: type: mongodb mongodb: dbname: ${ds.mongodb.dbname} host: ${ds.mongodb.host} port: ${ds.mongodb.port} ``` -------------------------------- ### Verify Gateway Accessibility Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/amazon-linux/installation-guide-amazon-gateway.adoc Sends a GET request to the Gateway's root endpoint to confirm it is running and accessible. A successful response indicates the installation is complete. ```bash curl -X GET http://localhost:8082/ ``` -------------------------------- ### Create a Demo Application Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/v4/event-native-tutorials-mqtt-webhooks.adoc Creates a simple demo application. This application will be used to subscribe to the API. ```json { "id": "7e15e1b6-80b5-43f3-95e1-b680b5e3f317", "name": "application", "description": "application", "status": "ACTIVE", "type": "SIMPLE", "created_at": 1675093592934, "updated_at": 1675093592934 ``` -------------------------------- ### Configure JDBC for Management Data (Docker Images) Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/docker/installation-guide-docker-customize.adoc Use this snippet to configure the Management API to use JDBC as its datastore when starting Docker images directly. Ensure the appropriate JDBC driver is installed. ```bash --env gravitee_management_type=jdbc \ --env gravitee_management_jdbc_url=jdbc:mysql://gravitee-mysql:3306/gravitee?useSSL=false&user=mysql_users&password=mysql_password \ ``` -------------------------------- ### Start AM components with systemd Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/red-hat/installation-guide-redhat-stack.adoc Starts the Gravitee.io Access Management gateway and management API, and restarts the Nginx service using systemd. ```bash sudo systemctl daemon-reload sudo systemctl start {gravitee-package-name}-gateway {gravitee-package-name}-management-api sudo systemctl restart nginx ``` -------------------------------- ### Configure Redis for Rate Limiting (Docker Images) Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/docker/installation-guide-docker-customize.adoc Use this snippet to configure the API Gateway to use Redis for rate-limiting counters when starting Docker images directly. Ensure the Redis plugin is installed. ```bash --env gravitee_ratelimit_type=redis \ --env gravitee_ratelimit_redis_host=gravitee-redis \ --env gravitee_ratelimit_redis_port=6379 \ ``` -------------------------------- ### Install All Gravitee APIM Components Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/amazon-linux/installation-guide-amazon-all.adoc Installs all Gravitee APIM 3.x components using yum. Ensure the Gravitee YUM repository has been added prior to execution. ```bash sudo yum install graviteeio-apim-3x -y ``` -------------------------------- ### Configure Conditional Logging - HTTP Method and Request Header Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/user-guide/publisher/logging-analytics.adoc This example demonstrates how to configure conditional logging to capture requests that are GET methods and include a specific 'X-debug' header with the value 'true'. It shows the process of adding conditions sequentially in the editor. ```yaml condition: - "HTTP Method == GET" - "X-debug == true" ``` -------------------------------- ### Download and Run Docker Compose Environment Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/docker/installation-guide-docker-compose.adoc Download the docker-compose.yml and .env files, optionally pull the latest images, and then start the AM environment using docker-compose up. ```shell # Download required Docker Compose files $ mkdir -p config $ curl -L -O https://raw.githubusercontent.com/gravitee-io/graviteeio-access-management/master/docker/compose/docker-compose.yml $ curl -O https://raw.githubusercontent.com/gravitee-io/graviteeio-access-management/master/docker/compose/.env $ cd config && { curl -O https://raw.githubusercontent.com/gravitee-io/graviteeio-access-management/master/docker/compose/config/nginx.conf ; cd -; } # (Optional step: pull to ensure that you are running latest images) $ docker-compose pull # And run... $ docker-compose up ``` -------------------------------- ### Install Nginx Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/red-hat/installation-guide-redhat-management-ui.adoc Installs the Nginx web server using yum. Ensure EPEL repository is enabled first. ```bash sudo yum install epel-release sudo yum install nginx ``` -------------------------------- ### Install AE using Helm Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/ae/installation-guide/installation-guide-kubernetes.adoc Installs the Gravitee AE using Helm. Ensure you have Helm installed and configured. ```bash helm install gravitee-ae gravitee-io/gravitee-ae --namespace gravitee --create-namespace ``` -------------------------------- ### Install Developer Portal Docker Image Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/docker/installation-guide-docker-images.adoc Pulls the Developer Portal UI Docker image and runs it as a container. Configures log volume, network, and the Portal API URL. ```bash docker pull graviteeio/apim-portal-ui:latest docker run --publish 8085:8080 \ --volume /gravitee/apim-portal-ui/logs:/var/log/nginx \ --net frontend \ --name gio_apim_portal_ui \ --env PORTAL_API_URL=http://localhost:8083/portal/environments/DEFAULT \ --detach graviteeio/apim-portal-ui:latest ``` -------------------------------- ### Start AKHQ with Docker Compose Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/v4/event-native-tutorials-akhq.adoc Use docker compose to download and start all AKHQ components in detached mode. ```bash docker compose -f docker-compose-akhq.yml up -d ``` -------------------------------- ### Install MongoDB Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/amazon-linux/installation-guide-amazon-prerequisite-mongodb.adoc Installs the MongoDB package using yum. The `-y` flag automatically confirms any prompts during the installation process. ```bash sudo yum install mongodb-org -y ``` -------------------------------- ### File Reporter Configuration Example Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/configuration/reporters/installation-guide-reporters.adoc Configure the file reporter to enable it, specify the output file path and format, and define event-specific inclusions, exclusions, and renames. This example excludes all fields except 'api' and 'application' for request events, renames 'application' to 'app', and excludes 'log', 'node', and 'healthcheck' events. ```yaml reporters: file: enabled: true fileName: ${gravitee.home}/metrics/%s-yyyy_mm_dd output: json request: exclude: - "*" include: - api - application rename: application: app log: exclude: * node: exclude: * healthcheck: exclude: * ``` -------------------------------- ### Install Nginx Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/amazon-linux/installation-guide-amazon-prerequisite-nginx.adoc Installs the Nginx web server package using yum. The '-y' flag automatically confirms any prompts during installation. ```bash sudo yum install nginx -y ``` -------------------------------- ### API Migration Example - Path and Methods Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/policy-reference/policies-migrate.adoc Illustrates how a path with policies having different HTTP methods is transformed into a flow that accepts the union of these methods. ```json "/path": [ { "policy1": {...}, "methods": ["GET", "POST"], ... }, { "policy2": {...}, "methods": ["GET", "DELETE"], ... } ] ``` -------------------------------- ### Migration Rule Example: Path and Methods Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/user-guide/publisher/design-studio/design-studio-migrate.adoc Illustrates how multiple policies with different HTTP method sets within a single path are consolidated. The resulting flow accepts the union of all methods, with conditions applied to each policy. ```json "/path": [{ "policy1": {...}, "methods": ["GET", "POST"], ... }, { "policy2": {...}, "methods": ["GET", "DELETE"], ... }] ``` -------------------------------- ### Install Java 11 OpenJDK Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/apim/3.x/installation-guide/amazon-linux/installation-guide-amazon-prerequisite-java.adoc Installs the Java 11 OpenJDK package on Amazon Linux. The '-y' flag automatically confirms the installation. ```bash sudo yum install java-11-openjdk -y ``` -------------------------------- ### Install Gravitee AM with Default Settings Source: https://github.com/gravitee-io/gravitee-docs/blob/master/pages/am/3.x/installation-guide/kubernetes/installation-guide-helm-options.adoc Install the Gravitee AM chart with default configurations. This is a basic installation and may require further customization for production environments. ```bash helm install gravitee-am gravitee/am ```