How to point all new domains coming through the IP address pointing to the same site?

Hi there,

I want to point all new domains coming to IP address (every domain set with A record to IP address) to be by default pointed to the site’s document root?

I tried editing 000-default.conf, apache2.conf but no luck.

I followed many solutions that are probably very old, but no idea what to do in case I am using HestiaCP (if that matters at all)…

I have ubuntu 22.04, latest apache2 and hestiacp.

For now, I need to manually add domains via HestiaCP and change their document root path, that works, but I want to automate it in case there are several domains, hundred domains…

You can edit /etc/apache2/conf.d/ip.conf how ever you won’t be able to get ssl for It.

You can also create a template that changes the default doc root…

Thanks for the quick response. I forgot to mention that SSL is also important part for all the domains, so enabling SSL Lets encrypt would be important.

How can I make that template, do you have any post to share about it?