Statamic + Laravel Consulting

šŸ‘‹

Hi there, welcome to my (very) small corner of the web, focused on my contributions to the Statamic and Laravel ecosystems.

Get to know me ā†’

Expose on Forge

Recently Marcel Pociot released Expose, a pure PHP replacement for Ngrok.

One of its neat features is that you can set it up on your own server so you can control the domain. I wanted to play with this and get it up and running on my Forge server, however I ran into a few challenges, so I'm sharing in case others find it useful.

Before you start, make sure you read Expose's docs.

  1. Make sure the domain you want to use has wildcard DNS set up
    • i.e. An A record for *.yoursite.com
    • Note that Forge only supports a few DNS providers for wildcard certs
    • For me this meant I had to move a domain to Digital Ocean.
  2. In Forge, create a standard php site and enable wildcard domains
  3. ssh in an composer require beyondcode/expose
  4. Publish the config expose publish, this puts a .expose directory in /home/forge.
  5. Edit the configuration in /home/forge/.expose/config.php :
    • 'database' => '/home/forge/.expose/expose.db',
    • Iā€™d recommend changing the admin user/password as well
  6. Link that config to ~, ln -s /home/forge/.expose/config.php /home/forge/.expose.php
  7. Create a daemon
    • Command: /home/forge/yoursite.com/vendor/bin/expose serve yoursite.com
    • Set the Directory to /home/forge

Locally, install Expose (composer global require beyondco/expose), then open the config (in ~/.expose/config.php) and set home to http://yoursite.com (note if you are serving this via SSL, change the port as well to 443).

To test, open Terminal, navigate to one of your locally served sites, and type expose. You could get something that looks like:

Congratulations, you're off and running!

Officially a Statamic Partner!

I've been involved in the Statamic community for several years now, and it continues to get better; more helpful, more friendly, more rad.

The people I work with have all been fabulous as well, never any payment issues (knock on wood), coming back for additional help & always open to suggestions on how to "do it right".

So I'm super proud to announce I, along with Dave Symth and Mike Martin, am now an official partner! I've been reviewed and scoured (didn't hurt too much) and approved.

Looking forward to working with more fine folks.

© 2020 Silent Z Consulting