How to create domain alias manually

Hi I have a domain example.com on VM.

I want to add dozens of alias for this domain, web enabled only, like www1.example.com, www2.example.com ... www50.example.com

Rather than do this by the GUI, what syntax would I use in batch create servers to make all of these Apache-only alias (no mail, no dns needed).

Thank you

Status: 
Active

Comments

Can I just add a bunch of:

ServerAlias www27.example.com

to httpd.conf. If I did this, would I be missing any other settings that the GUI makes?

Would these appear in the GUI under the primary domain? (in the server selection dropdown)

Yes, you can add those ... although you will also need to add the corresponding DNS entries.

Alternately, you can use the Virtualmin command-line API. The shell command to add an alias domain is like :

virtualmin create-domain --domain www27.example.com --alias example.com --web