0

At the moment, Liferay and Apache servers are manually deployed on servers.

I'm trying to start httpd:2.4.39-alpine and liferay/dxp:7.1.10-security-dxp-17-202003-3-202006050913 using Docker Compose on another server, using existing configurations.

Those are my configs:

  1. docker-compose.yml
version: "3.8"
services:
  mydxp:
    build:
      context: build/docker
    networks:
      - test-network
    image: liferay/dxp:7.1.10-security-dxp-17-202003-3-202006050913
    expose:
      - "8282"
    ports:
      - "8282:8080"
  myapache:
    build:
      context: docker-ref/apache
    networks:
      - test-network
    image: httpd:2.4.39-alpine
    expose:
      - "8181"
    ports:
      - "8181:33090"
    volumes:
      - "./docker-ref/apache/htdocs:/usr/local/apache2/htdocs"
      - "./docker-ref/apache/conf:/usr/local/apache2/conf"
networks:
  test-network:
  1. docker-ref/apache/conf/httpd.conf
Listen 33090
  1. docker-ref/apache/conf/extra/httpd-vhosts-local.conf
<VirtualHost *:33090>
    ServerName mydxp

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^127.0.0.1:8282$  [OR]
    RewriteCond %{HTTP_HOST} ^127.0.0.1:8282$
    # CUSTOM RewriteCond %{HTTPS} off
    RewriteRule ^/(?)$ http://%{HTTP_HOST}/web/developer/home

    # CUSTOM RequestHeader set X-Forwarded-Proto "https"
    ProxyPreserveHost On

    # Configuration for proxy page
    ProxyPass /css !
    ProxyPass /fonts/Open_Sans !
    ProxyPass /fonts/FontAwesome !
    ProxyPass /error_pages !
    ProxyPass /img !

    ProxyPass /disable http://%{HTTP_HOST}/error_pages/disable.html

    ErrorDocument 502 /error_pages/502.html

    ProxyPass / http://127.0.0.1:8282/
    ProxyPassReverse / http://127.0.0.1:8282/

    LimitRequestFieldSize 500000
    LimitRequestLine 500000
</VirtualHost>

When those containers start up, using http://localhost:8282/ return Liferay's homepage, but when I hit http://localhost:8181/ I get "503 Service Unavailable"

Is there a way for checking/debugging at which point the request is discarded/refused by Apache? Thank you

GokcenG
  • 2,771
  • 2
  • 25
  • 40

1 Answers1

1

The issue is about where the traffic is redirected to. Instead of

127.0.0.1:8282

I have used

<container_name>:8080

and the traffic is redirected correctly.

GokcenG
  • 2,771
  • 2
  • 25
  • 40