Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 835988e

Browse files
authored
Merge pull request #1090 from oxyc/php-socket-docs
Docs: Update examples to use SetHandler instead of ProxyPassMatch
2 parents 0195893 + aa149a1 commit 835988e

File tree

5 files changed

+17
-27
lines changed

5 files changed

+17
-27
lines changed

docs/deployment/local-codebase.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,7 @@ If you prefer using your domain as the root of all extra packages installed, ie.
4747

4848
```
4949
vagrant_hostname: "my-drupal-site.com"
50-
51-
apache_vhosts:
52-
# Resolves to http://my-drupal-site.com/
53-
- servername: "{{ drupal_domain }}"
54-
documentroot: "{{ drupal_core_path }}"
55-
extra_parameters: |
56-
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}"
57-
58-
# Resolves to http://adminer.my-drupal-site.com/
59-
- servername: "adminer.{{ vagrant_hostname }}"
60-
documentroot: "{{ adminer_install_dir }}"
61-
extra_parameters: |
62-
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ adminer_install_dir }}"
50+
drupal_domain: "{{ vagrant_hostname }}"
6351
```
6452
6553
## Update MySQL info

docs/deployment/multisite.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ drupal_core_path: "/var/www/my-drupal-site"
88
apache_vhosts:
99
# Drupal VM's default domain, evaluating to whatever `vagrant_hostname` is set to (drupalvm.dev by default).
1010
- servername: "{{ drupal_domain }}"
11+
serveralias: "www.{{ drupal_domain }}"
1112
documentroot: "{{ drupal_core_path }}"
12-
extra_parameters: |
13-
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}"
13+
extra_parameters: "{{ apache_vhost_php_fpm_parameters }}"
1414

1515
- servername: "local.second-drupal-site.com"
1616
documentroot: "{{ drupal_core_path }}"
17-
extra_parameters: |
18-
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}"
17+
extra_parameters: "{{ apache_vhost_php_fpm_parameters }}"
1918

2019
- servername: "local.third-drupal-site.com"
2120
documentroot: "{{ drupal_core_path }}"
22-
extra_parameters: |
23-
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}"
21+
extra_parameters: "{{ apache_vhost_php_fpm_parameters }}"
2422
```
2523
2624
If you need additional databases and database users, add them to the list of `mysql_databases` and `mysql_users`:

docs/extras/ssl.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ apache_vhosts_ssl:
1616
documentroot: "{{ drupal_core_path }}"
1717
certificate_file: "/vagrant/example.crt"
1818
certificate_key_file: "/vagrant/example.key"
19-
extra_parameters: |
20-
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}"
19+
extra_parameters: "{{ apache_vhost_php_fpm_parameters }}"
2120
```
2221
2322
For a list of all configuration options see the [`geerlingguy.apache` Ansible role's README](https://github.com/geerlingguy/ansible-role-apache#readme).
@@ -52,8 +51,7 @@ apache_vhosts_ssl:
5251
documentroot: "{{ drupal_core_path }}"
5352
certificate_file: "/etc/ssl/certs/ssl-cert-snakeoil.pem"
5453
certificate_key_file: "/etc/ssl/private/ssl-cert-snakeoil.key"
55-
extra_parameters: |
56-
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}"
54+
extra_parameters: "{{ apache_vhost_php_fpm_parameters }}"
5755
```
5856

5957
#### Nginx

docs/other/base-os.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Everything should work out of the box with RHEL 7.
3030

3131
## RedHat Enterprise Linux / CentOS 6
3232

33-
**Apache without FastCGI**: If you want to use Apache with CentOS 6 on Drupal VM, you will need to modify the syntax of your `apache_vhosts` and remove the `ProxyPassMatch` parameters from each one. Alternatively, you can use Nginx with the default configuration by setting `drupalvm_webserver: nginx` inside `config.yml`.
33+
**Apache without FastCGI**: If you want to use Apache with CentOS 6 on Drupal VM, you will need to modify the syntax of your `apache_vhosts` and remove the `extra_parameters: "{{ apache_vhost_php_fpm_parameters }}"` line from each one. Alternatively, you can use Nginx with the default configuration by setting `drupalvm_webserver: nginx` inside `config.yml`.
3434

3535
**PHP OpCache**: PHP's OpCache (if you're using PHP > 5.5) requires the following setting to be configured in `config.yml` (see upstream bug: [CentOS (6) needs additional php-opcache package](https://github.com/geerlingguy/ansible-role-php/issues/39)):
3636

docs/other/bigpipe.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,21 @@ Nginx is the recommended way to use BigPipe, for the following reasons:
2323

2424
Apache has three primary means of interacting with PHP applications like Drupal: `mod_php`, `mod_fastcgi`, and `mod_proxy_fcgi`. Drupal VM uses `mod_proxy_fcgi`, which is the most widely used and supported method of using Apache with PHP-FPM for the best scalability and memory management with Apache + PHP.
2525

26-
For all of these methods, you have to make sure `mod_deflate` gzip compression is disabled; you can do this by adding the following line immediately after the `ProxyPassMatch` line under a host in the `apache_vhosts` list inside `config.yml`:
26+
For all of these methods, you have to make sure `mod_deflate` gzip compression is disabled; you can do this by modifying the VirtualHost's `extra_parameters` parameter in the `apache_vhosts` list inside `config.yml`:
2727

28-
SetEnv no-gzip 1
28+
apache_vhosts:
29+
- servername: "{{ drupal_domain }}"
30+
serveralias: "www.{{ drupal_domain }}"
31+
documentroot: "{{ drupal_core_path }}"
32+
extra_parameters: |
33+
{{ apache_vhost_php_fpm_parameters }}
34+
SetEnv no-gzip 1
2935

3036
This will disable the `mod_deflate` module for any requests inside that directory.
3137

3238
If you want to switch Apache to use `mod_php` instead of proxying requests through PHP-FPM, you can make the following changes in `config.yml`:
3339

3440
1. Add `libapache2-mod-php7.0` to `extra_packages` in `config.yml`.
35-
2. Delete the `extra_parameters` under any Drupal site in the list of `apache_vhosts` (so there is no `ProxyPassMatch` rule).
41+
2. Delete the `extra_parameters` under any Drupal site in the list of `apache_vhosts` (so there is no `SetHandler` rule).
3642

3743
You can also disable PHP-FPM and remove the two `proxy` entries from `apache_mods_enabled` if you don't want to use PHP-FPM with Apache at all, but that's optional; it won't break anything to run Apache with `mod_php` and `mod_proxy_fastcgi` at the same time.

0 commit comments

Comments
 (0)