Skip to content

Sites

A site in rexenv is a domain, a docroot, a PHP version, a web server, a certificate and (usually) a database. Creating one wires all of that together; the rest of this section is about the parts you can change afterwards, which is all of them.

  • A domain — <name>.rex by default, changeable later, with the URL rewrite handled for WordPress.
  • A certificate, signed by your local CA, so the site opens on real HTTPS.
  • A PHP version, switchable in one click without touching anything else.
  • A web server — the shared nginx by default, or a per-site FrankenPHP, Apache or OpenLiteSpeed override (which runs where).
  • A database, for site types that need one, with credentials rexenv manages.
  • A log viewer, showing PHP, nginx and edge logs in one place — and rexenv’s own log on its own tab, which is where “why did nothing happen” is answered.
  • A terminal, opening in the docroot with the site’s own PHP and wp on PATH — or the same folder in your own terminal app, which has neither.
  • Per-site environment variables.

Through 0.4.0 every site was running or none was. Now a site has its own switch — Stop site on the row, rex site stop <domain>, or --all for every site at once — and the Sites list can be filtered by type as well as by status. It opens on All — every site visible on arrival — and only a tab you click changes that.

What “stop” can honestly mean here is narrower than it sounds, because a default site is not a process: the web server is one shared nginx and the PHP pool is shared by every site on that PHP minor. So stopping a site changes the serving surface and touches no shared process:

Leg A stopped site
nginx Its server block answers 503 on every path, with no PHP
The edge Route and certificate kept; answers rexenv’s own “stopped” page
Its own FrankenPHP or Apache backend Actually stopped — that process serves one site
Shared nginx, PHP pools, database, edge Untouched

The page a visitor gets is deliberate. It is headed This site is stopped, says Nothing is broken. You stopped this one site in rexenv, so it is served by nothing — every other site on this machine is still running, and names both ways back: Start site in the app, or rex site start <domain>. It names the site, never the address the request arrived on, so a stopped site reached through a tunnel does not offer a command nobody can run.

The switch is recorded in the database, not in memory, because services outlive the app: a site you stopped on Tuesday is still stopped after a relaunch. Starting is the inverse plus one thing — with the stack up, it starts the site’s PHP pool if that was down. It never starts the whole stack behind your back; if the edge is down, start records the site as enabled and says plainly that nothing will answer until the stack is started. rex site restart <domain> is the other verb: it restarts the site’s own backend, and only bounces the shared PHP pool with --pool, reporting how many sites that covers whether or not you passed the flag.

A site can answer on extra domains — the Domains card on the site, or rex site domains <domain> --add <name>. The primary stays the site’s address; the extras are aliases. A hostname reaches exactly one site: a name that is already some site’s primary or extra cannot be added, created or renamed onto, and the refusal names the owner — “shop.rex is already an extra domain of the site “Shop”.

Serving is singular on purpose: one nginx server_name list on one block, the extra addresses on the site’s own edge route, and one certificate covering every name. The certificate cache compares the recorded name set rather than checking that files exist, because “the files exist” left a valid certificate for yesterday’s names while the browser showed an interstitial on the one just added. Every path that issues a certificate — first issue, domain change, both Regenerate actions — carries the alias list; the last two forgot, and were fixed before release.

An extra domain on a new TLD makes that TLD resolve, with the usual admin prompt. An extra domain on a WordPress site reaches it and then redirects to the primary: WordPress owns its canonical address in siteurl, and rexenv does not rewrite it. The card and rex site domains say so rather than leaving the redirect to be discovered. rex site info answers with every name the site has, and rex site <verb> finds a site by any name it answers on.

Action What it changes What it does not
Rename The display name in the UI The domain, the folder, anything on disk
Change domain The domain and certificate, with a WordPress URL rewrite Your files
Move The docroot’s parent folder The domain or the database
Delete Drops the database and the docroot A linked folder — never

rex site delete asks before it acts, and the app makes you type the domain: it is the one action here that destroys data.

A site you have set up the way you like can be saved as a blueprint, and new sites can be stamped from it. rex blueprints lists them; rex site create --blueprint <name> uses one.