ローカル環境でdockerでapache、tomat、postgresのコンテナを作成し、連携しようとしているのですがtomcatとapacheのAJPの接続がうまくいきません。
ご教授願います。
httpd.conf 一部抜粋
Listen 80 LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so ProxyPass / ajp://127.0.0.1:8009/
server.xml 一部抜粋
<!-- <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/> --> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
docker ps の内容
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3a68b0292b1b dockerdir_apache "httpd-foreground" 35 seconds ago Up 33 seconds 0.0.0.0:80->80/tcp apache 0083abec2683 dockerdir_tomcat "/opt/tomcat/bin/c..." 36 seconds ago Up 34 seconds 0.0.0.0:8009->8009/tcp, 0.0.0.0:8080->8080/tcp tomcat 28b490fea146 dockerdir_postgresql "docker-entrypoint..." 38 seconds ago Up 35 seconds 0.0.0.0:9432->5432/tcp postgres-db b2a9c76f2970 busybox "sh" 39 seconds ago Exited (0) 37 seconds ago postgres-datastore
docker-compose.yml
apache: build: ./docker-apache container_name: apache restart: always ports: - "80:80" links: - tomcat:tomcat tomcat: build: . container_name: tomcat restart: always ports: - "8080:8080" - "8009:8009" links: - postgresql:pg postgres-data: image: busybox volumes: - /var/lib/postgresql/data container_name: postgres-datastore postgresql: build: ./docker-postgres restart: always environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres ports: - "9432:5432" container_name: postgres-db volumes_from: - postgres-data
http://localhost:80にアクセスするとエラー
apache | [Wed Jun 07 12:48:45.470909 2017] [proxy:error] [pid 6:tid 140608362505984] (111)Connection refused: AH00957: AJP: attempt to connect to 127.0.0.1:8009 (127.0.0.1) failed apache | [Wed Jun 07 12:48:45.470967 2017] [proxy_ajp:error] [pid 6:tid 140608362505984] [client 172.17.0.1:41466] AH00896: failed to make connection to backend: 127.0.0.1 apache | 172.17.0.1 - - [07/Jun/2017:12:48:45 +0000] "GET / HTTP/1.1" 503 299
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/07 13:37
2017/06/07 14:02
2017/06/07 21:37
2017/06/07 21:52
2017/06/08 01:43
2017/06/08 13:28