docker pull httpd:2.4-alphine
php
docker pull php: 7.3.1-fpm-alpine3.8
web
映射一個apache配置文件,去官網看configuration /usr/local/apache2/conf/httpd.conf
docker
拷貝到本地 docker cp myweb:/usr/local/apache2/conf/httpd.conf .
apache
修改本地Apache配置文件ui
1.去除三個地方的註釋(mod_proxy.so,/mod_proxy_http.so , modules/mod_proxy_fcgi.so )
2.幹掉默認配置
拷貝代碼
<VirtualHost *:8087> ServerAdmin ceshi.com DocumentRoot "/usr/local/apache2/htdocs" ServerName localhost <Directory "/usr/local/apache2/htdocs"> Options None Require all granted </Directory> ProxyRequests Off ProxyPassMatch ^/(.*\.php)$ fcgi://172.17.0.2:9000/php/$1 </VirtualHost>
注意這段 ProxyPassMatch ^/(.*\.php)$ fcgi://172.17.0.2:9000/php/$1
3d
1.查看默認配置code
2.查看到fpm容器端口 blog