I allow my users to use a custom domain. They create a CNAME and point to my site (dns.mysite.com).
Now i need to create a server block in sites-available and create the symlink in sites-enabled for my server to handle the request and provide their content. I'm thinking maybe i can use the symfony component Is there a more Laravel way to achieve this? Is this even a good idea?
I've tried this approach but if i write
$process = new Process(['touch /etc/nginx/sites-available/domain.com']); it executes the command in the project public folder, not from the server root folder
Edit 2: Also tried to use Process to call a Envoy macro but the command line asks for the root password
I've tried to
echo e- "password" | sudo -S command but no luck