Closed thomasjost closed 5 years ago
@thomasjost I'm working through this same problem. Did you happen to find a solution?
@emaclean03 I found a workaround, though the fix isn't ideal for production use. You can all the following to /etc/sudoers
:
#www-data ALL=(ALL:ALL) NOPASSWD: /etc/init.d/nginx configtest, /usr/sbin/service nginx configtest, /usr/sbin/service nginx reload
www-data ALL=(ALL:ALL) NOPASSWD: ALL
I wrote a blog about this as there were a couple other things I had to do, you can read it at: https://www.thomasjost.com/php/laravel/2019/12/31/visudo.html
I'm not keen on retyping everything else that I discuss in the blog here, though.
I actually wound up going a different route as well as I uncovered some scalability issues with multi-tenancy built this way -- I'd recommend you think carefully about going this route as well.
Description
On a fresh install of Debian 10, creation of new tenants fails. No nginx vhost file is created, and
/etc/init.d/nginx configtest
also fails. I've addedwww-data
to/etc/sudoers.d/www-data
, and restarted both nginx and php7.3-fpm.For reference, I followed https://medium.com/@alexleeelkins/multi-tenant-laravel-on-ubuntu-18-04-with-nginx-mariadb-and-php-7-3-a09377ef440f
Actual behavior
A record is created in the hostnames table, but no vhost file is generated and the above error occurs.
Expected behavior
Successful creation of a new tenant including vhost file.
Information
tenancy.php config
webserver.php config
Error log