dongzituo5530 2018-06-12 12:59
浏览 245

LAMP-Stack with Docker:如何修改httpd.conf以访问PHP-FPM?

I have some trouble to get access from my apache container to Php-fpm. My docker-compose file is ready and works fine. But I don't know how to modify the httpd.conf in order to establish communication between both containers (Apache and Php-fpm). I have looked for some useful tutorials on the internet, but everyone uses Nginx instead of Apache2. There is also a preconfigured Docker image consisting of a Apache webserver and Php-fpm on Docker Hub, but I prefer two seperated images, because of replaceability.

Here is my docker-compose file:

version: "3.5"

services:
  webserver:
    build: apache/
    ports:
           - "8080:80"
           - "443:443"
    volumes: 
             - ~/Docker-Images/example/apache/html:/usr/local/apache2/htdocs
    links: 
           - php-fpm

  php-fpm:
    build: php-fpm/
    ports:
           - "9000:9000"
    links: 
           - database


  database:
    build: mysql/
    ports: 
           - "3306:3306"
    volumes:
             - ~/Docker-Images/example/mysql/init-scripts:/init-scripts


volumes:
  webserver:
  database:

If you need my httpd.conf, let me know! I haven't added it, because it is a very long file with only default values.

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?