Your existing setup
How devmagic-panel lives next to sites made by hand or with the devmagic CLI: vhosts, hosts, wpcore, the files it adds, and taking over a site.
- Works with
- Sites made by hand, by the devmagic CLI or by the panel
- Changes
- Only its own vhosts, and one marked block in
/etc/hostsand in your crontab - Adds to a site
- Two must-use plugins, kept out of git locally
On this page
- What it changes and what it leaves
- Vhosts stay as they are
- Take over a site made by hand
- nginx runs next to Apache, never in its place
- Hosts entries go in one marked block
- wpcore is shared
- The two files the panel adds to a site
- .htaccess
- Your crontab keeps its lines
- Removing, reinstalling and restoring a site
- Nothing goes into a repo
The panel works next to sites the devmagic CLI or you made by hand, and changes only what is its own.
What it changes and what it leaves
| Part | The panel changes | It leaves alone |
|---|---|---|
| Apache vhosts | Vhosts that start with its marker | Vhosts made by hand or by devmagic |
/etc/hosts |
Its own marked block | Every line outside the block |
| Your crontab | Its own marked block | Lines you wrote with crontab -e |
| nginx | Its own configs, Apache's ports.conf, Debian's default site |
Configs you wrote |
| A site's files | Two must-use plugins, and an .htaccess when there is none |
An .htaccess your repo tracks |
| Your repos | Only their local .git/info/exclude |
What you commit: nothing it adds shows in git status |
Taking over a site is the one exception: its own lines in /etc/hosts move
into its takeover record, and Give back puts them back.
Vhosts stay as they are
The panel only rewrites or removes a vhost whose first line is its own marker. Sites made by hand or by devmagic keep their vhost. The panel still reissues their certificate and manages their hosts line.
When you want every panel feature on such a site, you can take it over.
Take over a site made by hand
On a site whose vhost you made by hand, the panel does not:
- change its domains;
- move it to nginx, alone or in front of Apache;
- add the lines for a site under one of its paths (the install shows them, for you to add);
- remove it to the trash when its vhost file has another name;
- send missing uploads to production from the vhost (Local mode does that instead).
Everything else works as on the panel's own sites: certificates, the hosts line in the panel's block, PHP, the database, files, logs and cron. Each of the places above says so, with a Take over... link.
Check what would happen
Take over... on the site's Overview first shows what would happen, read by
dmp-root vhost-adopt --check:
- its vhost files, names and folder, and its sites under a path;
- every line the panel's vhost does not have;
- its lines in
/etc/hostsoutside the panel's block.
What a takeover does
- Its vhost files are kept, root-owned with checksums, in
$STATE_DIR/taken-over/<domain>. - Its folder stays where it is (it must be a real folder right in
WEB_DIR) and is registered, so removal and restore know it by its name. - The certificate comes from the panel's CA. The panel writes its own vhost with the same names and sites under a path, and the hosts line goes into its block.
- Its own lines in
/etc/hostsoutside the panel's block move into the takeover record, each with the line before it (see below). - If Apache's configtest fails, the original vhost is put back at once.
The site then shows Made by hand, managed by the panel since its date, with a Taken over badge and a filter on the Sites page.
Its lines in /etc/hosts
A line written by hand that names only the site's names would keep deciding where the site goes, so the site could never move to nginx. That is why such lines move into the takeover record.
A line that also names another host stays, and the dialog says so. The site then stays on Apache until you take it off that line by hand.
What stops a takeover
- Lines the panel's vhost does not have (headers, rewrites,
php_valueand the like) are refused until you tick to leave them out. They stay in the kept files. - A real domain among its names, a file that also holds another site, or
a folder outside
WEB_DIRstops the takeover, with the reason.
Give a site back
Give back, or Undo on the job, puts its own vhost files back, checked against their checksums, and its hosts lines where they were. Its line in the panel's block goes then. The panel leaves the site as it is again; the site and its certificate stay.
A site on nginx, alone or in front of Apache, cannot be given back as it is, since its own vhost is for Apache alone. Move it back to Apache on Server and PHP first, then Give back. The card says so, and Give back waits until then.
Sites taken over before 1.37.0
Such a site still has its hosts line written by hand. Moving it to nginx moves
that line into the takeover record first, as a step of the move
(dmp-root hosts-adopt), and Give back puts it back the same way.
nginx runs next to Apache, never in its place
Once you set nginx up, Apache answers on 127.0.0.1 and nginx on
127.0.0.2, both on ports 80 and 443. Other devices on your network no
longer reach Apache.
A site goes to the server its hosts line points at. The panel and phpMyAdmin stay on Apache.
A site on nginx
A site you move to nginx gets /etc/nginx/sites-available/<domain>.conf, with
the panel's marker and its PHP through PHP-FPM. Sites under its paths go
along, each from its own folder with its own PHP.
nginx reads no .htaccess. The rules the panel translated from it, once you
reviewed them, are in that file as # rule: lines with the directives under
them, and the checksum of each .htaccess as # htaccess: lines.
nginx in front of Apache
A site with nginx in front of Apache keeps its Apache vhost, and gets the same
<domain>.conf, which passes requests to Apache on 127.0.0.1 over HTTPS.
The first such site adds conf-available/devmagic-panel-remoteip.conf and
turns mod_remoteip on, so Apache sees the visitor's address from nginx, and
from nginx only. Turning nginx off takes both out again.
What stays on Apache
- Vhosts made by hand, and names in hosts lines outside the panel's block, keep their sites on Apache. A taken over site's own lines are the exception: they move into its takeover record, and the move says which line it is.
- nginx configs you wrote stay as they are. One that listens on port 80 or
443 on every address keeps nginx from starting next to Apache, so the setup
names it and waits until it listens on
127.0.0.2or is off.
Turning nginx off
Turning nginx off puts Apache's ports.conf and Debian's default site back,
and stops nginx.
Hosts entries go in one marked block
The panel's lines in /etc/hosts sit between # BEGIN devmagic-panel and
# END devmagic-panel, one line per site. Everything outside the block is
left alone.
The one exception: taking over a site moves the lines that name only that site into its takeover record, and Give back puts them back.
wpcore is shared
The panel uses the same /etc/wpcore.conf and cores folder as the wpcore
command, so a core added from either side shows up in both.
The two files the panel adds to a site
Both are must-use plugins in wp-content/mu-plugins/. Both do nothing when
the site's address is not a local name.
Note Both files are excluded from git in the repo's local
.git/info/exclude, never.gitignore. They never show up ingit statusand are never committed.
One-click wp-admin login
devmagic-panel-login.php is added to each site you use one-click login on.
It only accepts one-time links the panel makes, for 60 seconds.
Local mode
devmagic-panel-local.php keeps a local copy away from real people. New sites
get it; existing sites get it when you turn it on, on the site's page or in
Aura. It:
- sends all mail to Mailpit (
127.0.0.1:1025), tagged with the site so the Mail page can show it; - blocks requests to mail APIs and any hosts you add;
- tells search engines not to index, and shows a Local label after the site name in the admin bar;
- accepts logins only from this computer, since Apache answers on every network address and a simple local password must not work from another machine;
- reads the theme of a repo in
wp-content/reposthat keeps it in a folder of its own, under the theme's own name; - lets wp-admin install and update plugins without FTP details (
FS_METHODdirect, whenwp-config.phpsets none); - on a network, makes a long My Sites menu fit the window and scroll, with a filter once it lists 10 sites;
- for vhosts made by hand, sends missing uploads to production.
Local mode has the details.
.htaccess
The panel writes an .htaccess only when a site has none: on new installs, or
with the Aura fix. It holds WordPress's own rules for a single site or a
network, and is kept out of git locally. An .htaccess your repo tracks is
never changed.
Your crontab keeps its lines
The panel's cron tasks live in one marked block, between
# BEGIN devmagic-panel and # END devmagic-panel, and the panel changes only
those. Lines you wrote with crontab -e are shown and left as they are.
A site's WP-Cron runs from page loads as before, until you switch it to cron on its Cron tab.
Removing, reinstalling and restoring a site
Removing a site works for any site in the usual layout
(/var/www/<domain> with a <domain>-ssl.conf vhost), made by the panel or
not:
- It exports the database.
- It archives the folder, vhost, certificate and dump.
- Only then does it remove them and drop the database, and the site's own database user.
The copy waits under Removed on the Sites page, to restore for 14 days, and is purged after that. Hosts lines outside the panel's block stay as they are.
Reinstalling or restoring over a site archives the current one the same way first, after you confirm, so nothing is lost. The wizard warns when the domain is installed already, and a restore asks when the site exists again. Undo on the job puts the current site back.
Nothing goes into a repo
The new site wizard keeps its answers per repo in the panel's own database, and its install drafts for 24 hours after the last change. Nothing is written into your repos for it.
Checked against devmagic-panel 1.67.0.