Skip to content

Commit

Permalink
Minor docs updates (#2664)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Nov 27, 2020
1 parent 24b4575 commit 5b2ee26
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions docs/users/alternate-uses.md
Expand Up @@ -21,18 +21,30 @@ This may be completely appropriate for small or abandoned sites that have specia
1. Install DDEV-Local on a regular Linux server that is directly connected to the Internet. You're responsible for your firewall and maintenance of the server, of course.
2. On Debian/Ubuntu, you can set up a simple firewall with `ufw allow 80 && ufw allow 443 && ufw allow 22 && ufw enable`
3. Point DNS for the site you're going to host to the server.
4. Before proceeding, your project must be accessible on port 80 and your project DNS name (myproject.example.com) must resolve to the appropriate server.
4. Before proceeding, your system and your project must be accessible on the internet on port 80 and your project DNS name (myproject.example.com) must resolve to the appropriate server.
5. Configure your project with `ddev config`
6. Import your database and files using `ddev import-db` and `ddev import-files`.
7. Use `ddev config global --router-bind-all-interfaces` to tell DDEV to listen to all network interfaces, not just localhost.
8. Use `ddev config global --use-hardened-images` to tell DDEV to use a hardened image which does not contain sudo, for example.
9. Use `ddev config global --use-letencrypt --letsencrypt-email=you@example.com` to configure Let's Encrypt.
10. Create your DDEV-Local project as you normally would, but `ddev config --additional-fqdns=<internet_fqdn`.
11. `ddev start` and visit your site. Clear your cache (on some CMSs).
7. Use `ddev config global --router-bind-all-interfaces --omit-containers=dba,ddev-ssh-agent --use-hardened-images --use-letsencrypt --letsencrypt-email=you@example.com` to tell DDEV to listen to all network interfaces (not just localhost), not provide PHPMyAdmin or ddev-ssh-agent, use the hardened images, and turn on Let's Encrypt.
8. Create your DDEV-Local project as you normally would, but `ddev config --additional-fqdns=<internet_fqdn`. If your website responds to multiple hostnames (for example, with "www" and without it) then you'll need to add each hostname.
9. `ddev start` and visit your site. Clear your cache (on some CMSs).

You may have to restart ddev with `ddev poweroff && ddev start --all` if LetsEncrypt has failed due to port 80 not being open or the DNS name not yet resolving. (Use `docker logs ddev-router` to see Let's Encrypt activity.)

To make ddev start sites on system boot, you'll want to set up a systemd unit on systemd systems like Debian/Ubuntu and Fedora. For example, a file named /etc/systemd/system/ddev.service containing:
#### Additional Server Setup

* Depending on how you're using this, you may want to set up automated database and files backups (preferably offsite) as on all production systems. Many CMSs have modules/plugins to allow this, or you can use `ddev export-db` or `ddev snapshot` as you see fit and do the backup on the host.
* You may want to allow your host system to send email (for notifications from the host itself). On Debian/Ubuntu `sudo apt-get install postfix`. Typically you'll need to set up reverse DNS for your system, and perhaps an SPF record in order for other systems to accept the email.
* You may want to update your php settings to use other than the defaults. For example, the error-reporting defaults in php.ini are very aggressive and you may want something less:

```ini
; Error handling and logging ;
error_reporting = E_ALL
display_errors = On
display_startup_errors = On
log_errors = On
```

* To make ddev start sites on system boot, you'll want to set up a systemd unit on systemd systems like Debian/Ubuntu and Fedora. For example, a file named /etc/systemd/system/ddev.service containing:

```
# Start ddev when system starts (after docker)
Expand Down Expand Up @@ -61,7 +73,7 @@ WantedBy=multi-user.target
Caveats:

* It's unknown how much traffic a given server and docker setup can sustain, or what the results will be if the traffic is more than the server can handle.
* DDEV-Local does not provide outgoing SMTP mailhandling service, and the development-focued MailHog feature is disabled if you're using `use_hardened_images`. You can provide SMTP service a number of ways, but the recommended way is to enable SMTP mailsending in your application and leverage a third-party transactional email service such as SendGrid, Mandrill, or Mailgun. This is the best way to make sure your mail actually gets delivered. See [DDEV-Live email sending docs](https://docs.ddev.com/services/#email) for hints.
* DDEV-Local does not provide outgoing SMTP mailhandling service, and the development-focused MailHog feature is disabled if you're using `use_hardened_images`. You can provide SMTP service a number of ways, but the recommended way is to enable SMTP mailsending in your application and leverage a third-party transactional email service such as SendGrid, Mandrill, or Mailgun. This is the best way to make sure your mail actually gets delivered. See [DDEV-Live email sending docs](https://docs.ddev.com/services/#email) for hints.
* You may need an external cron trigger for some types of CMS.
* Debugging Let's Encrypt failures requires viewing the ddev-router logs with `docker logs ddev-router`
* A malicious attack on a website hosted with `use_hardened_images` will likely not be able to do anything significant to the host, but it can certainly change your code, which is mounted on the host.
Expand Down
Binary file modified docs/users/images/usage_stats.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5b2ee26

Please sign in to comment.