This article is also available in our new Knowledge Base: Adding a virtual host via the CLI
Applies To
All versions of Zend Server Since 6.3
Issue
There are times when it's necessary to add a virtual host via the CLI. Here is the process to do that.
Solution
- Use the GUI to create, or get your Web API key under Administration > Web API > Add Key
- Enter the command line as follows (please note that individual values will differ)
/usr/local/zend/bin/zs-manage vhost-add -n magento2 -p 80 -N <API_KEY_NAME> -K <API_KEY_HASH> - The output will look like this after
vhostInfo 2 magneto2 80 false PendingRestart
Zend Server will need to be restarted for this change to take effect.
This can also be done from zs-manage by running:
/usr/local/zend/bin/zs-manage restart -N <API_KEY_NAME> -K <API_KEY_HASH>
More information
Comments