Processwire package config - how to make nginx and Apache play nicely together

Hello all

I have some questions about how Yunohost works with apps, as part of troubleshooting Processwire install on Yunohost.

Describe the bug

After successful install of processwire, the processwire admin page will not successfully accept default login details.

Context

Hardware:

  • main YH instance: Old computer - Mac Mini circa 2014 (running on VM via VirtualBox)

YunoHost version: 11.2.3

I have access to my server :

  • Through SSH
  • through the webadmin
  • direct access via keyboard / screen

Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

This follows from my previous, related thread here: https://forum.yunohost.org/t/yunohost-package-404-on-admin-page-after-first-successful-install/27695

Steps to check admin credentials

What I have tried:

Attempt 1. Entering log in credentials created at Processwire setup

Result 1. Unable to log in. user and password boxes reset.

Attempt 2. Checking login username is correct in PHPMyAdmin by running @BitPoet’s suggested query: Reset Admin Password or Add SuperUser Rol - General Support - ProcessWire Support Forums

select name from pages where id = 41;

Also checked the ‘pages’ table:

Result 2. Superuser admin name I’m using is correct.

Attempt 3. Re-setting credentials via a code snippet added to home.php, as recommended by @ryan in 2012: forgot backend password, how do you reset?! - Getting Started - ProcessWire Support Forums

  1. Downloading the home.php file via SFTP.
  2. Adding the php inside the php code brackets at the top of the home.php file.
  3. Changing the admin and pass details to my own.
  4. Saving home.php locally.
  5. Uploading home.php via SFTP.
  6. In browser (Safari), refreshing view of my home page: https://domain.tld
  7. In browser (Safari), refreshing view of my admin page: https://domain.tld/processwire
  8. Entering new login details, press enter. Login page refreshes, deletes entries, does not log me in.

Result 3: No errors, but also can’t log in using re-set credentials.

Attempt 4: Re-setting credentials via a code snippet by @kongondo above: Reset Admin Password or Add SuperUser Rol - General Support - ProcessWire Support Forums

Result 4: Same steps as before, same result.

Attempt 5: Re-setting credentials via a code snippet by @bernhard above: Reset Admin Password or Add SuperUser Rol - General Support - ProcessWire Support Forums

Result 5: Same steps as before, same result.

Attempt 6: Creating a tool.php file and adding code snippet to it as recommended by @Soma here: forgot backend password, how do you reset?! - Getting Started - ProcessWire Support Forums

Result 6: Similar steps as before, but no noticeable change, and no successful login.

After this experiment, I deleted tool.php, but even so, my errors all refer to the tool.php file.

Quote

2024-01-16 21:40:49 guest https://domain.tld/http404/ Fatal Error: Uncaught Error: Call to undefined function wire() in /var/www/processwire/tool.php:3 Stack trace: #0 {main} thrown (line 3 of /var/www/processwire/tool.php)

This seems to be an issue about Processwire using Apache2, and Yunohost using nginx.

To investigate further, I need some more detail about how Yunohost nginx works.

My questions

  • is Yunohost is using nginx as a proxy to the Processwire package?
  • is the Processwire app itself is being served by apache2?
  • if not, how does the nginx in yunohost work?

I am seeking support on the Processwire forum, to (hopefully!) resolve the Yunohost Processwire package issue. Answers to these questions will give folks over there the necessary detail to navigate this issue with me.

Thanks for reading, and I hope to hear from someone soon. :crossed_fingers: :rainbow:

bump

Anyone?

@ericg - pinging you in case you’re interested re the Processwire package, and hoping you know an answer.

@tituspijean - pinging you because you know Yunohost so intimately.

Hi nqo,

I was under the impression that Processwire was installed as a Yunohost app, and thought to see if it gives default credentials while installing.

With reference to the request-thread, do I understand correctly that it is not the case?

  1. nginx is not used especially for Processwire as a reverse proxy. If you have a look in ls /etc/nginx/conf.d of your Yunohost, you’ll see that there is an nginx-config for each of the installed applications.
  2. Not per se, but it is the preferred web server by the Processwire-folks. They have more than one page with requirements; the list in the ‘download’ section mentions “Apache or compatible”, while the list in the ‘about’ section says “Apache and others, see nect paragraph”: ProcessWire is also able to run on any non-Apache server with a few adjustments.
  3. I don’t understand the question. I think the way to go is to
    1. use the ‘My Webapp’-app,
    2. download Processwire according to their instructions
    3. match the nginx-config to fit Processwire

Maybe steps 3.1 - 3.3 is just what you did :slight_smile:

In your post you list all the steps that you have done at the front end. Did you also have a look at logs? What happens there?

It is not totally clear to me what does happen in the front end.

There is no error, it just does not log in?

There’s a post on stackoverflow from some five years ago, suggesting to set session.auto_start = false in the php.ini file.

Good luck troubleshooting!

-edit-
PS: I think it is not necessary to @call other users on the forum. Active members will see your post anyway and post a reply if they have time and they feel they can help. Members who don’t visit so often probably won’t see that they are called either.

And, one more edit, on the Processwire-forums someone seems to have somewhat similar(?) problems, and has the Processwire-part resolved in the end.

Hi @wbk

Thank you for your detailed response! :smile:

tl:dr reply…

I will try this and report back here :point_down:

wbk:
There’s a post on stackoverflow from some five years ago, suggesting to set session.auto_start = false in the php.ini file.

Follow up questions

  1. Are you saying Yunohost uses nginx as a reverse proxy for all apps?

  2. And does presence of an nginx-config file always mean nginx is running as a reverse proxy?

  3. Does apache2 get packaged within the Yunohost Processwire app?

  4. Is nginx acting as a reverse proxy AND webserver for the Yunohost Processwire app (and/or any other app)?

  5. How else is nginx interacting with the Processwire package?


My full comments below…

wbk:
I was under the impression that Processwire was installed as a Yunohost app, and thought to see if it gives default credentials while installing.

The issue I’m referring to happens both ways of installing

  • via the Yunohost Processwire app package, and
  • installing it via My Web App.

I have tested both ways, and documented these tests here and on the Yunohost app package GitHub issues here (both issues listed are relevant).

First, both installing the Yunohost Processwire app and installing via MyWebApp result in an nginx error screen.

After a lot of trial and error with nginx settings, I got the Processwire admin login to appear. But it is not accepting the default admin login credentials.

wbk:
Did you also have a look at logs? What happens there?

There are no errors in the log because, according to Yunohost, Processwire installs successfully.

wbk:
There is no error, it just does not log in?

Yes, correct.

wbk:
I think it is not necessary to @call other users on the forum.

Good tip, I appreciate it. :pray:

wbk:
On the Processwire-forums someone seems to have somewhat similar(?) problems, and has the Processwire-part resolved in the end.

You might be referring to me on the Processwire forum. :laughing: I am one of those people posting about the issue on the Processwire forum. Only part of the issue is resolved.

On the Processwire forum there is a lot of debate over a decade about how to actually get Processwire to work using both Apache and nginx. In practise it is a lot harder than the documentation suggests. I see over the years most people - except the most advanced Processwire users - abandon trying to use Processwire with nginx.

But I love Yunohost, and I love Processwire. So I am keen to find a way to make them play nice together.

wbk:
There’s a post on stackoverflow from some five years ago, suggesting to set session.auto_start = false in the php.ini file.

Good tip, I don’t think I’ve tried this yet. Thank you.

nqo:
is Yunohost is using nginx as a proxy to the Processwire package?

wbk:
nginx is not used especially for Processwire as a reverse proxy. If you have a look in ls /etc/nginx/conf.d of your Yunohost, you’ll see that there is an nginx-config for each of the installed applications."

  1. Are you saying Yunohost uses nginx as a reverse proxy for all apps?

  2. And does presence of an nginx-config file always mean nginx is running as a reverse proxy?

Nqo:
is the Processwire app itself is being served by apache2?"

Wbk:
Not per se, but it is the preferred web server by the Processwire-folks.

See above re Processwire functioning. I’m asking for Yunohost-context information.

Perhaps I need to ask a more specific question:

3. Does apache2 get packaged within the Yunohost Processwire app?

I have some basic LAMP stack experience, but no knowledge of packaging apps (yet!).

Nqo:
if not, how does the nginx in yunohost work?

wbk:
I don’t understand the question.

Some more specific questions might help :crossed_fingers:

  1. Is nginx acting as a reverse proxy AND webserver for the Yunohost Processwire app (and/or other Yunohost apps generally)?

  2. How else is nginx interacting with the Processwire package?

I’m asking for specifics about how Yunohost uses nginx in a more detailed way than is available in the documentation.

This is for diagnostic purposes. Ericg has kindly packaged Processwire. He said he “has no idea” how to fix this known login issue. I am very motivated to attempt to find a solution. I have the time.

Perhaps the answer I’m looking for seems too obvious to you, but no matter how simple, it could be valuable information to me. So please feel free to share ideas/thoughts/random guesses - nothing is too small or simple, and what you offer may be just what I need!

I hope this makes sense, and someone can share their insight.

Hi nqo,

Sorry for not replying any sooner; offline took attention :wink:

Thanks for your elaborate description of the problems you face. I’m afraid I can’t help you any further.

I hate to say it, but you may be a bit on your own here.

  • Yunohost provides an easy to install and easy to manage platform, based on packages that one or more people create and maintain out of need or for fun
  • Yunohost provides ‘custom web app’ for advanced users to run their own services
  • Processwire offers a platform running on Apache by default, with other web servers as an option for advanced users

With currently no Yunohost package for Processwire, it seems you find yourself in the Venn-crosshairs of two ‘advanced’ use cases.

Things should work, with some pushing and pulling. My path, never having used Processwire, and Apache only sometimes, would be:

  • test a simple application as custom web app on Yunohost, to get familiar with this bit of functionality, interaction with SSO, and things written to log in stages of using an application
  • run Processwire on a seperate (virtual) server with the default Apache
  • run Processwire on a (different) seperate (virtual) server with Nginx, see if things work/log the same
  • see if I can combine things

Good luck!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.