database.js different Path

Post Reply
eques
Posts: 2
Joined: Wed Aug 09, 2017 1:52 pm

database.js different Path

Post by eques »

Greetings!

I'm fairly new to WonderCMS but so far i'm quite loving it.

We try to let 1 database.js be the one and only Database for up to 5 Instances of WonderCMS.
We only use 2 Textareas which are embedded into some sort of a dashboard.

The Folder in which to find the file is mounted via SMB to the root folder.

I got it working as far so that the multiple Instances can read the database but i can't reach the loginURL (which we called "admin") Panel.

Right now i only modified the index.php for the remote database.js. In our case ./PiDaten/database.js

I'm sure there is something critical missing but i'm at a dead end.

Really appreciate your help
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: database.js different Path

Post by wiz »

Hi eques, welcome and thank you.

What an unique problem and modification!

A couple of questions:
1. Did the login URL work prior to the changes you've made? A default installation of WonderCMS on your server and trying to reach the loginURL will answer this question the easiest.
2. Do all other pages load normally, or is it just the loginURL? Try visiting /home for example. It might be a URL rewrite issue.
3. What does loginURL do for you on the default installation, and what does it show on your modified installation. Is it an error?
eques
Posts: 2
Joined: Wed Aug 09, 2017 1:52 pm

Re: database.js different Path

Post by eques »

Hi wiz, thanks for your reply.

1) i configured everything beforehand and it worked just fine when used locally (database.js in the same folder as index.php). (Editing the Textareas, settings etc). After this step, i copy the whole filestructure to the new pc(raspberry) and change the index.php and copy the database.js to the smb path.
2) Home doesn't load either.
3) I get a 404 error
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: database.js different Path

Post by wiz »

If you always get a 404 error:
- the condition that takes care of this in WonderCMS is:

Code: Select all

if ( ! wCMS::$loggedIn && ! wCMS::$currentPageExists) header("HTTP/1.0 404 Not Found");
- this means you're getting a 404 possibly because of the user not being logged or current page doesn't exist
- this could possibly mean that there is some sort of misconfiguration in the database (not correctly fetching pages)

Could you run a test of WonderCMS on the RaspberryPi alone, without any additional tunnels/smb? It would be easier to work from there since I have no clue how you've set this up and why it thinks the page doesn't exist. As far as I understand, all your 5 sites are correctly reading one database, but not displaying pages properly/always returning a 404?

I recommend a URL rewrite test - try visiting yourWonderCMSwebsite.com/?page=loginURL or yourWonderCMSwebsite.com/?page=home (or any other page that you know exists) to see what it returns. If visiting this URLs work, there's a problem with the .htaccess URL rewrite.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: database.js different Path

Post by wiz »

Just to add to the discussion, if you're running on IIS, check this web.config for proper WonderCMS use (in case you don't have clean URLs):
https://github.com/robiso/wondercms/wik ... ver-config
Post Reply