Clients, sites and PHP

Give clients SSH logins, pin each site to its own PHP, change PHP settings, and turn sites and clients off or remove them.

6-minute read Applies to XenoPanel 1.0.0 Updated

A client is one Linux user, and a site is one domain belonging to one client. Each site has its own PHP build, its own PHP-FPM service running as the client’s user, and its own nginx vhost, so a change to one site never touches another.

Clients and their logins

Terminal
$ xenopanel client add acme
$ xenopanel client key add acme --key ~/Downloads/acme.pub
$ xenopanel client key list acme  # each key's fingerprint
$ xenopanel client key remove acme --fingerprint SHA256:…

A client’s name is their Linux user name: lowercase letters, digits, _ and -, starting with a letter. Clients log in over SSH or SFTP with their keys (password logins are off for everyone), and can’t reach other clients’ files. Each client has a shell, so they can run Composer, deploy with XenoDeploy and edit their own crontab.

Adding a site

Terminal
$ xenopanel site add example.com --client acme --php 8.4 --web-root public
  • Folders: the site lives in /home/acme/htdocs/example.com/, and its logs in /home/acme/logs/example.com/, where the client can read them.
  • Web root: the folder that’s served, inside the site’s folder: public unless you choose another, or . for the folder itself.
  • PHP: a series such as 8.4 takes its newest patch; an exact patch such as 8.4.12 pins that one.
  • XenoDeploy: with --xenodeploy, the site serves current/<web root>, the release XenoDeploy switches live, and XenoPanel never writes inside the site’s folder.

xenopanel site status example.com shows the site’s PHP, its service, its paths and the PHP command to use for it, for example in the client’s crontab. xenopanel site list shows every site on the server.

Changing a site’s PHP

Terminal
$ xenopanel site php example.com --series 8.5  # the newest 8.5
$ xenopanel site php example.com --patch 8.4.27
$ xenopanel site php example.com --set memory_limit=512M --set upload_max_filesize=64M
$ xenopanel site php example.com --set memory_limit=  # back to the default

Each PHP patch is installed once on the server and shared, read-only, by the sites that use it. --set takes the common settings: memory_limit, upload_max_filesize, post_max_size, max_execution_time, max_input_time, max_input_vars and date.timezone. For anything else, edit the site’s overrides.ini, for example /etc/xenopanel/sites/example-com/overrides.ini: XenoPanel keeps it as you wrote it.

Turning things off

  • xenopanel site disable example.com stops the site’s PHP-FPM service, and its vhost answers 503. site enable turns it back on.
  • xenopanel client disable acme locks the client’s login and turns off every one of their sites. client enable brings back the login and the sites it turned off. While a client is off, their sites can’t be turned on one by one.

Removing sites and clients

Terminal
$ xenopanel site remove example.com --confirm example.com
$ xenopanel client remove acme --confirm acme

Removing a site takes away its PHP-FPM service, vhost, certificate and settings. Its files stay unless you add --delete-files, and --delete-databases drops its databases, each after a full dump. A client can be removed only once they have no sites; their home is kept, owned by root, unless you add --delete-files. Deleted files can’t be brought back.

Questions about XenoPanel?

Check the help pages first, or send us a message and we’ll get back to you within 24 hours.

Need help with an app or a license? Open a support ticket →

We reply within 24 hours on business days.