4

I updated ddev to version 1.3.0 and ran ddev config. After that I changed the configuration from nginx-fpm to apache-fpm. After starting ddev and checked the HTTP headers, there is nginx/1.15.3 used. Is there something else to do, to get Apache working?

My config.yaml:

APIVersion: v1.3.0
name: example
type: typo3
docroot: public
php_version: "7.2"
webserver_type: apache-fpm
router_http_port: "8080"
router_https_port: "8443"
xdebug_enabled: true
additional_hostnames: []
additional_fqdns: []
provider: default
hooks:
  post-start:
  - exec: composer install -d /var/www/html
  - exec: ../vendor/bin/typo3cms cache:flush
  - exec: ../vendor/bin/typo3cms database:updateschema
  - exec: yarn --cwd typo3conf/ext/theme/Resources/Private install
Chris
  • 427
  • 4
  • 13

1 Answers1

4

That is such a good question! I know because I already got stumped by it myself when writing tests.

The answer is: Apache runs in the web container but when you use the http://*.ddev.local URL, it goes through ddev-router, which is an nginx reverse proxy, and that's why you see the nginx headers. But rest assured you are using Apache. You can confirm that these ways:

  • ddev ssh and ps -ef to see what's running
  • Hit the 127.0.0.1 URL reported by ddev start and ddev describe. That URL goes directly to the web container, for example http://127.0.0.1:33221 - You'll see the apache headers on that one.

Your question is so good - Could you please edit the title to something like "Why do I see nginx headers when ddev is configured to use apache?" - I think other people will find it that way.

$ curl -I http://127.0.0.1:33224
HTTP/1.1 200 OK
Date: Fri, 12 Oct 2018 02:18:26 GMT
Server: Apache/2.4.25 (Debian)
Cache-Control: must-revalidate, no-cache, private
X-Drupal-Dynamic-Cache: HIT
X-UA-Compatible: IE=edge
Content-language: en
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary:
X-Generator: Drupal 8 (https://www.drupal.org)
X-Drupal-Cache: MISS
Content-Type: text/html; charset=UTF-8
rfay
  • 9,963
  • 1
  • 47
  • 89
  • Thank you very much for your answer, via 127.0.0.1 I see the header. But now the problem is, that I get a 404 for the TYPO3 frontend (the backend works). I think, the rewrites are not in place. I am calling / which got redirected to /en, which seems not to be routed via TYPO3. There I got also the signature "Apache/2.4.25 (Debian) Server at example.ddev.local Port 8080" – Chris Oct 12 '18 at 14:30
  • So you should probably be using the canonical URL (like http://something.ddev.local) to access your TYPO3 site, especially if you have configured that in there. If you have apache in the config.yaml, it's apache that's doing the webserving. I wasn't trying to get you to switch to the 127.0.0.1 approach, just using that to show you the headers. When you use the normal URL it just hops through nginx (just a reverse proxy) to the apache-hosted web container. But probably this deserves another venue. TYPO3 slack #ddev channel? – rfay Oct 12 '18 at 19:48