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

Commit 3566b31

Browse files
authored
Merge pull request #1088 from oxyc/docs-makeover
Issue #1092: Docs makeover
2 parents 5906155 + 25acaf5 commit 3566b31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+521
-404
lines changed

default.config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ drupal_site_install_extra_args: []
9090
# Cron jobs are added to the vagrant user's crontab. Keys include name
9191
# (required), minute, hour, day, weekday, month, job (required), and state.
9292
drupalvm_cron_jobs: []
93-
# - name: "Drupal Cron"
94-
# minute: "*/30"
95-
# job: "drush -r {{ drupal_core_path }} core-cron"
9693

9794
# Drupal VM automatically creates a drush alias file in your ~/.drush folder if
9895
# this variable is 'true'.
File renamed without changes.

docs/extras/mariadb.md renamed to docs/configurations/databases-mariadb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ mysql_socket: /var/lib/mysql/mysql.sock
2525
mysql_log_error: /var/log/mariadb/mariadb.log
2626
mysql_syslog_tag: mariadb
2727
mysql_pid_file: /var/run/mariadb/mariadb.pid
28-
```
28+
```

docs/extras/mysql.md renamed to docs/configurations/databases-mysql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ By default, this VM is set up so you can manage MySQL databases on your own. The
22

33
## Connect using Adminer
44

5-
If you have `adminer` listed as one of the `installed_extras` inside `config.yml`, you can use Adminer's web-based interface to interact with databases. With Drupal VM running, visit `http://adminer.drupalvm.dev/`, and log in with `drupal` as the username and the password you set in `config.yml` (`drupal_db_password`). Leave the "Server" field blank. The "Database" field is optional.
5+
If you have `adminer` listed as one of the `installed_extras` inside `config.yml`, you can use Adminer's web-based interface to interact with databases. With Drupal VM running, visit [http://adminer.drupalvm.dev/](http://adminer.drupalvm.dev/), and log in with `drupal` as the username and the password you set in `config.yml` (`drupal_db_password`). Leave the "Server" field blank. The "Database" field is optional.
66

77
More about how to use Adminer: [Adminer website](http://www.adminer.org/).
88

docs/extras/postgresql.md renamed to docs/configurations/databases-postgresql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ To switch from MySQL to PostgreSQL, switch the `drupalvm_database` setting in yo
66
drupalvm_database: pgsql
77
```
88
9-
For more PostgreSQL configuration options, see the README included with the [`geerlingguy.postgresql`](https://galaxy.ansible.com/geerlingguy/postgresql/) Ansible role.
9+
For more PostgreSQL configuration options, see the [`geerlingguy.postgresql` Ansible role's README](https://github.com/geerlingguy/ansible-role-postgresql#readme).
File renamed without changes.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Drupal VM's configuration works with multiple operating systems _and_ with multiple webservers. You can switch between Apache and Nginx (depending on which server you prefer) with ease. Apache is the webserver used out of the box.
2+
3+
You have complete control over all aspects of Apache VirtualHosts using the `apache_vhosts` configuration. A few simple examples are shown in `default.config.yml`, but this configuration can be much more complex.
4+
5+
See the examples included in the [`geerlingguy.apache` Ansible role's README](https://github.com/geerlingguy/ansible-role-apache#readme) for more info, as well as many other variables you can override to configure Apache exactly how you like it.
6+
7+
## Enable SSL Support with Apache
8+
9+
To enable SSL support for you virtual hosts you first need a certificate file. You can generate a self-signed certificate with a command like
10+
11+
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout example.key -out example.crt
12+
13+
_If you're using an actual production certificate you should of course **NOT** track it in git but transfer it to the VM before running `vagrant provision`_
14+
15+
Add the following to your `config.yml`:
16+
17+
```yaml
18+
apache_vhosts_ssl:
19+
- servername: "{{ drupal_domain }}"
20+
documentroot: "{{ drupal_core_path }}"
21+
certificate_file: "/vagrant/example.crt"
22+
certificate_key_file: "/vagrant/example.key"
23+
extra_parameters: "{{ apache_vhost_php_fpm_parameters }}"
24+
```
25+
26+
### Using Ubuntu's snakeoil certificate
27+
28+
If you are using Ubuntu as your base OS and you want to get started quickly with a local development environment you can use the snakeoil certificate that is already generated.
29+
30+
```yaml
31+
apache_vhosts_ssl:
32+
- servername: "{{ drupal_domain }}"
33+
documentroot: "{{ drupal_core_path }}"
34+
certificate_file: "/etc/ssl/certs/ssl-cert-snakeoil.pem"
35+
certificate_key_file: "/etc/ssl/private/ssl-cert-snakeoil.key"
36+
extra_parameters: "{{ apache_vhost_php_fpm_parameters }}"
37+
```
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
To use Nginx instead of Apache, change the `drupalvm_webserver` variable inside your customized `config.yml`, from `apache` to `nginx`.
2+
3+
Because Nginx server directives behave a little differently than Apache's VirtualHosts, Drupal VM includes a custom Drupal-optimized Nginx server block configuration, and you can control all the servers ('virtual hosts') Nginx will run using the `nginx_hosts` configuration. A few simple examples are shown in `default.config.yml`, but you have some extra flexibility if you need it. See the `nginx-vhost.conf.j2` template for more information.
4+
5+
Also, see the examples included in the [`geerlingguy.nginx` Ansible role's README](https://github.com/geerlingguy/ansible-role-nginx#readme) for more info, as well as many other variables you can override to configure Nginx exactly how you like it.
6+
7+
_Note: if you're using php-fpm, you may want to reflect your use of nginx by setting `php_fpm_pool_user` and `php_fpm_pool_group` in your `config.yml`._
8+
9+
## Enable SSL Support with Nginx
10+
11+
To enable SSL support for you virtual hosts you first need a certificate file. See the same section under the [Apache documentation](webservers-apache.md#enable-ssl-support-with-apache) for how to generate a self-signed certficiate.
12+
13+
Modify your nginx host configuration by adding the following `extra_parameters` to the first entry in `nginx_hosts`:
14+
15+
```yaml
16+
- server_name: "{{ drupal_domain }} www.{{ drupal_domain }}"
17+
root: "{{ drupal_core_path }}"
18+
is_php: true
19+
extra_parameters: |
20+
listen 443 ssl;
21+
ssl_certificate /vagrant/example.crt;
22+
ssl_certificate_key /vagrant/example.key;
23+
ssl_protocols TLSv1.1 TLSv1.2;
24+
ssl_ciphers HIGH:!aNULL:!MD5;
25+
```
26+
27+
### Using Ubuntu's snakeoil certificate
28+
29+
If you are using Ubuntu as your base OS and you want to get started quickly with a local development environment you can use the snakeoil certificate that is already generated.
30+
31+
```yaml
32+
- server_name: "{{ drupal_domain }} www.{{ drupal_domain }}"
33+
root: "{{ drupal_core_path }}"
34+
is_php: true
35+
extra_parameters: |
36+
listen 443 ssl;
37+
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
38+
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
39+
ssl_protocols TLSv1.1 TLSv1.2;
40+
ssl_ciphers HIGH:!aNULL:!MD5;
41+
```

docs/other/drupalvm-composer-dependency.md renamed to docs/deployment/composer-dependency.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ composer require --dev geerlingguy/drupal-vm
1010

1111
### Setup your configuration files
1212

13-
Add and configure the `config.yml` anywhere you like, in this example we place it in a `config/` directory. If you're using `build_makefile` this will be the default location Drupal VM looks for the `drupal.make.yml` file.
13+
Add and configure the `config.yml` anywhere you like, in this example we place it in a `config/` directory.
1414

15-
_Note: This will be the directory where Drupal VM looks for other local configuration files as well. Such as [`local.config.yml` and `Vagrantfile.local`](overriding-configurations.md)._
15+
_Note: This will be the directory where Drupal VM looks for other local configuration files as well. Such as `build_makefile`, `local.config.yml` and `Vagrantfile.local`._
1616

1717
```
1818
├── composer.json
@@ -29,7 +29,7 @@ _Note: This will be the directory where Drupal VM looks for other local configur
2929
└── drupal-vm/
3030
```
3131

32-
Change the build strategy to use your `composer.json` file by setting:
32+
Change the [build strategy to use your `composer.json`](composer.md#using-composer-when-drupal-vm-is-a-composer-dependency-itself) file by setting:
3333

3434
```yaml
3535
build_composer_project: false
@@ -41,9 +41,11 @@ drupal_core_path: "{{ drupal_composer_install_dir }}/docroot"
4141
4242
If you intened to use the devel module, it must be added as a requirement to your `composer.json` file. Alternatively, if you do not intend to use it remove it from `drupal_enabled_modules` in your `config.yml` file:
4343

44-
`drupal_enabled_modules: []`
44+
```yaml
45+
drupal_enabled_modules: []
46+
```
4547

46-
If you're using `pre_provision_scripts` or `post_provision_scripts` you also need to adjust their paths to take into account the new directory structure. The examples used in `default.config.yml` assume the files are located in the Drupal VM directory. If you use relative paths you need to the ascend the directory tree as far as the project root, but using the `config_dir` variable you get the absolute path of where you `config.yml` is located.
48+
If you're using `pre_provision_scripts` or `post_provision_scripts` you also need to adjust their paths to take into account the new directory structure. The examples used in `default.config.yml` assume the files are located in the Drupal VM directory. You can use the `config_dir` variable which is the absolute path of the directory where your `config.yml` is located.
4749

4850
```yaml
4951
post_provision_scripts:
@@ -101,9 +103,9 @@ vagrant up
101103

102104
_Important: you should never issue `vagrant` commands through Drupal VM's own `Vagrantfile` from now on. If you do, it will create a secondary VM in that directory._
103105

104-
## Drupal VM without composer
106+
## Drupal VM in a subdirectory without composer
105107

106-
If you don't use `composer` in your project you can still download Drupal VM (or add it as a git submodule) to any subdirectory in your project. As an example let's name that directory `box/`.
108+
If you're not using `composer` in your project you can still download Drupal VM (or add it as a git submodule) to any subdirectory in your project. As an example let's name that directory `box/`.
107109

108110
```
109111
├── docroot/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Out of the box Drupal VM is configured to use `composer create-project` to build a Drupal 8 codebase.
2+
3+
This is set up with the following variables in `config.yml`:
4+
5+
- Composer will build the project if `build_composer_project` is `true`, and `build_makefile` and `build_composer` are both `false`.
6+
- The Composer package is defined by `drupal_composer_project_package`.
7+
- Adjust the create-project CLI options in `drupal_composer_project_options` as well as add additional dependencies in `drupal_composer_dependencies`.
8+
- Ensure that the webroot configured in the Composer package matches the one set in `drupal_core_path`. The default is set to `web/`.
9+
10+
With [acquia/lightning-project](https://github.com/acquia/lightning-project) as an example your `config.yml` settings would be:
11+
12+
```yaml
13+
drupal_composer_project_package: "acquia/lightning-project:^8.1.0"
14+
drupal_composer_project_options: "--prefer-dist --stability rc --no-interaction"
15+
drupal_core_path: "{{ drupal_composer_install_dir }}/docroot"
16+
```
17+
18+
_Opting for composer based installs will most likely increase your VM's time to provision considerably. Find out how you can [improve composer build performance](../other/performance.md#improving-composer-build-performance)._

0 commit comments

Comments
 (0)