Skip to main content

Websites

Listing sites on a server

Command

mogwai sites list

Example output

ID      SERVER_NAME             ALIASES                         OWNER                   MODE    PHP_VERSION     IPS             DOCUMENT_ROOT
1 example.com www.example.com example_com_usr mpm_itk 82 127.0.0.1 /var/www/example_com_usr/data/www/example.com

Note: Site IDs from this list are used in other commands.

Creating a new site

Command

mogwai sites create --server-name=SERVER-NAME --owner=OWNER [<flags>]

Options

  • --owner : User on the FASTPANEL system who will own the site.
  • --server-name=SERVER-NAME : Domain name for the site.
  • -a, --alias=ALIAS : Aliases for the site, such as www subdomains. Multiple aliases can be specified.
  • --ip=IP : IP address of the server where the site will run. Multiple IP addresses can be specified.
  • -m, --php-mode=PHP-MODE : PHP processing mode, can be cgi,mpm_itk,php_fpm,fcgi.
  • --php-version=PHP-VERSION : PHP version. You can only specify an installed version, without a dot - for example, 73.
  • --create-user : Create a user for the site.

Example command

mogwai sites create --server-name=example.com --owner=user --create-user --alias=www.example.com --ip=127.0.0.1 --php-mode=fcgi --php-version=73

Deleting a site

Command

mogwai sites delete --id=ID

The site ID can be obtained from the mogwai sites list command.

Example command

mogwai sites delete --id=987

This command will delete site with ID 987

Modifying site settings

Command

mogwai sites update --id=ID [<flags>]

The site ID can be obtained from the mogwai sites list command.

Options

  • -i, --id=ID : ID of the site.
  • -a, --add-alias=ADD-ALIAS : Add an alias, multiple aliases can be specified.
  • --del-alias=DEL-ALIAS : Delete an alias, multiple aliases can be specified.
  • --add-ip=ADD-IP : Add an IP address from the site settings, multiple IP addresses can be specified.
  • --del-ip=DEL-IP : Delete an IP address from the site settings, multiple IP addresses can be specified.
  • -m, --php-mode=PHP-MODE : PHP processing mode, can be cgi,mpm_itk,php_fpm,fcgi.
  • --php-version=PHP-VERSION : PHP version. You can only specify an installed version, without a dot - for example, 73.
  • --gzip : Enable compression.
  • --no-gzip : Disable compression.
  • --gzip-comp-level=LEVEL : Set the compression level, 1-9.
  • --expires=EXPIRES : Set the caching time for static content.
  • --worker-count=WORKER-COUNT : Set the number of workers for PHP-FPM

You can also update settings for multiple sites on a server using the command

mogwai sites batch-update
  • To change the settings for all sites, use the -a flag.
  • To change the settings for selected sites, specify multiple --id flags with their IDs.

Example command

mogwai sites update --id=3 -a www1.example.com -m cgi --php-version=56

This command will add an alias www1.example.com, change handler to cgi and PHP Version to 5.6 for site with ID 3

Example command

mogwai sites batch-update -m cgi --php-version=56 --id 3 --id 2

This command will change PHP handler for sites with ID 2 and 3