Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain how to set up a queue with elevated permissions #26

Open
bkintanar opened this issue Jun 21, 2018 · 0 comments
Open

Explain how to set up a queue with elevated permissions #26

bkintanar opened this issue Jun 21, 2018 · 0 comments

Comments

@bkintanar
Copy link
Member

Moved from tenancy/multi-tenant#347

Description

The php script to create a new tenant website reports the following error:

The command "/etc/init.d/nginx configtest" failed.

Exit Code: 1(General error)

Working directory: /home/vagrant/Code/cff/public

Output:

================

  • Testing nginx configuration
    ...fail!

Error Output:

================

Actual behavior
The tenant database has been created, including the tenant folder and the tenant nginx .config file. However the nginx .config file is not complete:

Here are the contents of the file:

Auto generated Apache configuration
@author: hyn/multi-tenant
@see: http://laravel-tenancy.com
@time: 14:29:11 12-12-2017
@website id: 47
@website uuid: fb1396bbdadf445fbce6ee215f382908

   No hostnames found

that' all there is in this file.....

The remaining part of the website creation is abandoned, the hostname has not been created and the hostname is not attached to the website.

As a result, the new tenant web site cannot be accessed.

Expected behavior

..


Information

A few days ago, the code ran without any problem. After that I have upgraded to Hyn/multi-tenancy 5.0.15.

It might have something to do with access rights.

If I run "/etc/init.d/nginx configtest" manually from the command prompt, it returns an error. But if I run
"sudo /etc/init.d/nginx configtest", it reports no errors in the nginx config files.

Trying to find a solution, I added "sudo" in the webserver.php file in the nginx section like this:
original code "'test-config' => '/etc/init.d/nginx configtest',
changed code 'test-config' => 'sudo /etc/init.d/nginx configtest',

Then, this error did not occur, but the next error appeared instead:

"The command "systemctl restart nginx" failed."

Adding "sudo" to this line in the webserver.php file did not work.

  • hyn/multi-tenant version: 5.0.15
  • laravel version: 5.5
  • database driver and version: MariaDB 10.2
  • webserver software and version: nginx version: nginx/1.13.3
  • php version: 7.1
  • vagrant 2.01 with laravel/homestead (virtualbox, 5.0.1)

I have removed the laravel/homestead box completely and reinstalled a new one. That did not help either.

tenancy.php config

As attached

webserver.php config

As attached

Error log

As attached

TenantController.php: see attachment

[error.zip](https://github.com/hyn/multi-tenant/files/1552086/error.zip)
@luceos luceos changed the title The command "/etc/init.d/nginx configtest" failed when creating new website Explain how to set up a queue with elevated permissions Jun 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants