MageHost - MageHost Tooling: Savvii

Gewijzigd op Di, 20 Dec, 2022 om 1:02 PM

Disclaimer: MageHost has joined forces with Savvii. Therefore, these articles are only relevant to existing MageHost customers. For more information on this, visit www.savvii.com/en/magehost.  


Introduction

MageHost focuses on empowering customers to manage their own hosting account. Our customer's developers have SSH access, which is used for changes, deployment and automation. To provide an easy entry point for a growing number of management tasks of the hosting account we have created our own CLI tool: savvii

This tool is based on Symfony console and has tabbed autocomplete.


Commands

Below is a description of our commands and how you can use them in real situations. This list will gradually grow depending on the needs of our customers and automation. When in doubt, you can always use --help after any command.

savvii  account:info:show

This command gives more info on the whereabouts of credentials and paths needed to connect to the services in your account.

savvii  account:services:show

This lists all linked services in your account and their versions, this can come in handy when looking for bugs / checking change logs.

savvii  php:version:switch  {PHPversion}

This will switch your PHP version. When your environment has custom settings or extensions that are not covered, you will be asked to contact our support so we can switch manually to retain them. To list what PHP versions are available, you can just run the command without a predefined version.

savvii  php:newrelic:add  {licensekey}

Will add the newrelic daemon to the current PHP version and reload PHP for it to work. You will need the New Relic license key:

savvii  php:newrelic:remove

Will remove the new relic daemon from the current PHP version

savvii  ssl:domains:add  {domain}  [domain]

This command checks your domain settings and if they pass, it adds your domain to the certificate. Since we check a lot of points against the original name server (CAA, IPV4/IPV6, validation with a file,...), the command might have a small delay depending on how fast our queries get a response.


Warning: when swapping domains, please make sure you add the new domain to the certificate before removing the A/AAA record. Use savvii savvii ssl:domains:remove after the add.

savvii  ssl:domains:remove  {domain}  [domain]

This command removes the requested domain. It will not perform extra checks against the original name server since you might have removed the domain before removing the certificate.

savvii  ssl:domains:list

This lists domains that are already present in your SSL certificate.

savvii  logs:varnish:filter  --{filter}={value}

This command contains predefined filters to parse the Varnish logs. It is used to simplify the use of the varnishlog command. All filters can be chained to make logging as specific as possible. In the next section, you can find some real life use cases.

savvii  logs:access:filter  --{filter}={value}

This command filters the access logs (HaProxy or Apache) and creates a list showing top clients by IP or a list showing top visited URL paths.


Use cases / pitfalls

Continuous Integration

When you want to test your code per feature branch, it can come in handy to have  appropriate domains to visit (for example featurexxx.my-company.dev). When building your feature, you can add the certificate with:

savvii  ssl:domains:add  featurexxx.my-company.dev

When your tests are done, and you clean up the domains, you should always delete the domain from the certificate before deleting the domains from your DNS server:

savvii  ssl:domains:remove  featurexxx.my-company.dev

If your CI does not know what domains are added, you can work with 1 fixed domain and remove all others with the help of:

savvii  ssl:domains:list

Varnish Debugging

To prevent too much noise when debugging Varnish, you can start by filtering the logs with your own IP, this comes in handy when you can reproduce the problem at hand.

savvii  logs:varnish:filter  --ip='xxx.xxx.x.x'

If you have a large web application with multiple domains, and you (for example) want to revise the hash of a single page, you can use the --path and --domain filter. In some cases, you might even want to chain this with the --ip filter.

savvii  logs:varnish:filter  --path='/product-xx'  --domain='my-company.com'


Was dit artikel nuttig?

Dat is fantastisch!

Hartelijk dank voor uw beoordeling

Sorry dat we u niet konden helpen

Hartelijk dank voor uw beoordeling

Laat ons weten hoe we dit artikel kunnen verbeteren!

Selecteer tenminste een van de redenen
CAPTCHA-verificatie is vereist.

Feedback verzonden

We stellen uw moeite op prijs en zullen proberen het artikel te verbeteren