NS8 Webserver questions

I’m having some trouble getting Meteotemplate working in a virtual host using the Webserver module. Specifically running into three questions:

  • Does the setting below enable url_fopen? Because I have it enabled as shown, but the application is reporting that url_fopen is disabled.
    image
    • …and if it doesn’t, how can it be enabled?
  • Is the webserver able to write to its own data directory? Meteotemplate uses a setup page which (is supposed to) write a config.php file to its directory, and this is failing.
    • Likewise, if it isn’t, can this be changed?
  • How would I track down the cause of a completely blank page? I’m assuming it’s a PHP error of some sort, but the webserver logs are completely silent.

Confirmed, no, it does not:

So how to enable it? I see the question was asked last year here, but no answer there.

Yes, it should.

  • AllowUrlfOpen : This option enables the URL-aware fopen wrappers that enable accessing URL object like files. use enabled|disabled
    Source Code

“AllowUrlfOpen”:“URL-aware fopen wrappers”,

It worked on my side, enabling it at first vhost creation:

But disabling or enabling it again, only took effect after a (web)server restart (or after reloading php service). Which could be a Bug.

runagent -m webserver1 systemctl --user reload phpfpm@8.3
1 Like

If related webserver services are started and the request reaches the server, they should be reporting and logging errors/warnings.
Sometimes browser console can give some hint.
If it’s a php file, a quick way to see generated php errors is to force showing them for the file code in question, by editing the file and adding (usually at the top of the file, within the usual <?php code marks ?>):

ini_set('display_errors', 1);
error_reporting(E_ALL);

I can confirm it behaves this way, and I’d certainly consider it a bug.

1 Like

I try to reproduce, thank a lot

fun, we already reload the service

ok I got a fix

we are waiting verifications about this topic

1 Like

Upgrade existing instance

(without paying attention to #7083)

  • From app update on existing instance and virtual host the fopen fix didn’t work.
  • Creating a new virtual host, replaced the old virtual host (if mind doesn’t play tricks on me) but retained folder data, sftpgo access and http route + added the new http route.
  • On one occasion, all virtual hosts showed the same user:password hint (9001:9001) instead of their own, but refreshing the page solved it.
  • Creating a new virtual host without choosing php version, then editing it and chosing php version, php remains inaccessible:
    Screenshot
  • Editing virtual host by changing php version, changes are applied (site accessible and fopen status according to what was set on the UI).

All of the above without having restarted the server.

Clean Install of new (dev) webserver instance

  • Fix worked.

EDIT: on new test, can confirm that upgrade of an instance with virtualhost1, creating a new virtual host morphed virtualhost2 into virtualhost2 (instead of creating new vhost it took over the first one).

2 Likes

@france I think it is what you saw too ?

it should, can you check in log if you get a restart of the phpfpm container

interesting yes

yes we got something workable :stuck_out_tongue:

I really think so. The video I shared with you shows this if at least it’s the same problem.

thank you so much mates, I try to reproduce

@dnutan I asked you to upgrade from the webserver:1.0.20-dev.1 the previous version before the fix about fopen is fixed, but you find a major issue relative to vhost, I am on it

hum I can reproduce something weird … wtd :stuck_out_tongue:

Are you sure you dropped a new phpinfo file in the vhost, your test case did not mention it. By the way I cannot reproduce, without php the file is downloaded, with php the file is displayed an I can see the php settings as usual.

I have a fix, thank for your tests @dnutan

indeed…webserver is more and more used than before and it is good but nobody see this bug since the beginning

As far as i can remember, Yes

1 Like