[GH-ISSUE #31] OpenNote not working on subdomain. #28

Closed
opened 2026-02-26 01:34:58 +03:00 by kerem · 7 comments
Owner

Originally created by @vincurekf on GitHub (Feb 6, 2014).
Original GitHub issue: https://github.com/JLiscom/OpenNote/issues/31

Hi, i have a question about running OpenNote on subdomain (note.domain.cz).
But when i tried to run it i've got this:

The requested URL /note/controller/modules/login/ was not found on this server.

So i tried to change the default web path in settings and i added a dot to path to Authenticater (because when i leave it on defalt i get the error above again:

public static $loginModulePath = "./modules/login/Authenticater.php"; //path from common

...

/**
 * get web root
 */
    public static function getWebRoot(){
        return "http://note.domain.cz/";
    }

That helped but i have another problem with Authenticater.php script not being included correctly:

Warning: include_once(/data/www/XXXXXX/domain_cz/note/controller./modules/login/Authenticater.php): failed to open stream: No such file or directory in /data/www/19361/domain_cz/note/controller/common.php on line 10

Can someone please tell me what to do?

Originally created by @vincurekf on GitHub (Feb 6, 2014). Original GitHub issue: https://github.com/JLiscom/OpenNote/issues/31 Hi, i have a question about running OpenNote on subdomain (note.domain.cz). But when i tried to run it i've got this: ``` The requested URL /note/controller/modules/login/ was not found on this server. ``` So i tried to change the default web path in settings and i added a dot to path to Authenticater (because when i leave it on defalt i get the error above again: ``` public static $loginModulePath = "./modules/login/Authenticater.php"; //path from common ... /** * get web root */ public static function getWebRoot(){ return "http://note.domain.cz/"; } ``` That helped but i have another problem with Authenticater.php script not being included correctly: ``` Warning: include_once(/data/www/XXXXXX/domain_cz/note/controller./modules/login/Authenticater.php): failed to open stream: No such file or directory in /data/www/19361/domain_cz/note/controller/common.php on line 10 ``` Can someone please tell me what to do?
kerem closed this issue 2026-02-26 01:34:58 +03:00
Author
Owner

@JLiscom commented on GitHub (Feb 8, 2014):

Do you have this subdomain in a different web structure then the primary?

I operate my personal instance of OpenNote on a subdomain and I cant reproduce this error.

<!-- gh-comment-id:34549786 --> @JLiscom commented on GitHub (Feb 8, 2014): Do you have this subdomain in a different web structure then the primary? I operate my personal instance of OpenNote on a subdomain and I cant reproduce this error.
Author
Owner

@vincurekf commented on GitHub (Feb 8, 2014):

Well, my primary folder is at "/data/www/XXXXXX/fswitch_cz/" and subdomains are just subfolders.

note.fswitch.cz = ".../fswitch_cz/note/".
and main domain works in the same way:
www.fswitch.cz = ".../fswitch_cz/www/"

You can see it here http://note.fswitch.cz.

I even tried to set the base in .htaccess simply by

    RewriteEngine on
    RewriteBase /

But it's weird to me, because when i remove the dot from here:

public static $loginModulePath = "./modules/login/Authenticater.php"; //path from common

it should load the module correctly but then i can't acces index page, the main page to be exact.

<!-- gh-comment-id:34552497 --> @vincurekf commented on GitHub (Feb 8, 2014): Well, my primary folder is at "/data/www/XXXXXX/fswitch_cz/" and subdomains are just subfolders. ``` note.fswitch.cz = ".../fswitch_cz/note/". and main domain works in the same way: www.fswitch.cz = ".../fswitch_cz/www/" ``` You can see it here http://note.fswitch.cz. I even tried to set the base in .htaccess simply by ``` RewriteEngine on RewriteBase / ``` But it's weird to me, because when i remove the dot from here: ``` public static $loginModulePath = "./modules/login/Authenticater.php"; //path from common ``` it should load the module correctly but then i can't acces index page, the main page to be exact.
Author
Owner

@JLiscom commented on GitHub (Feb 9, 2014):

I can't seem to reproduce the problem.

Can you revert the changes to public static function getWebRoot(). It looks like from the post above you modified the code that parses out the local directory include path.

You can keep the same $loginModulePath variable change

<!-- gh-comment-id:34564725 --> @JLiscom commented on GitHub (Feb 9, 2014): I can't seem to reproduce the problem. Can you revert the changes to public static function getWebRoot(). It looks like from the post above you modified the code that parses out the local directory include path. You can keep the same $loginModulePath variable change
Author
Owner

@JLiscom commented on GitHub (Feb 9, 2014):

I just pulled down the latest build and deployed it to my personal instance and it is okay.

Maybe its the way the sub domain is setup. I have my subdomain as a cname record to another instance. Do you have the subdomain configured some how in Apache or is it a completely separate like a cpanel like setup?

<!-- gh-comment-id:34564942 --> @JLiscom commented on GitHub (Feb 9, 2014): I just pulled down the latest build and deployed it to my personal instance and it is okay. Maybe its the way the sub domain is setup. I have my subdomain as a cname record to another instance. Do you have the subdomain configured some how in Apache or is it a completely separate like a cpanel like setup?
Author
Owner

@vincurekf commented on GitHub (Feb 9, 2014):

I don't set my subdomains in any way, i just create subfolder and the domain starts working immediately.

Ok, i revrerted the changes, now when i try it, got this:
again, opennote is trying acces the files on vrong path.

http://note.fswitch.cz/note/controller/modules/login/

when i add a dot before path at line #64

i can acces opennote, but then its trying import Authenticater with the dot before.

...cz/note/controller./modules/login/Authenticater.php): failed to open stream: No such file or directory...

I allso tried change this line:

include_once dirname(__FILE__).Config::$loginModulePath; //this must be first...

to

include_once dirname(__FILE__)."./modules/login/Authenticater.php";//this must be first...

but the same apears, opennote is trying acces web on:
http://note.fswitch.cz/note/controller/modules/login/

So maybe the problem is in "dirname(__FILE__)"?
Isn't it expecting from me to have opennote in some subfolder on my main domain, and then, assuming that "note.fswitch.cz" is not subdomain but simply subfolder under main domain?

From what i can see, maybe the solution is substr-ing the name of subdomain from the main calling path, but i dont know how...

And yes, i downloaded the last version, last commit 32b3873a32
This is very weird... :D

<!-- gh-comment-id:34569240 --> @vincurekf commented on GitHub (Feb 9, 2014): I don't set my subdomains in any way, i just create subfolder and the domain starts working immediately. Ok, i revrerted the changes, now when i try it, got this: again, opennote is trying acces the files on vrong path. http://note.fswitch.cz/note/controller/modules/login/ when i add a dot before path at line [#64](https://github.com/FoxUSA/OpenNote/blob/master/OpenNote/Config.php#L64) i can acces opennote, but then its trying import Authenticater with the dot before. ...cz/note/controller./modules/login/Authenticater.php): failed to open stream: No such file or directory... I allso tried change this line: ``` php include_once dirname(__FILE__).Config::$loginModulePath; //this must be first... ``` to ``` php include_once dirname(__FILE__)."./modules/login/Authenticater.php";//this must be first... ``` but the same apears, opennote is trying acces web on: http://note.fswitch.cz/note/controller/modules/login/ So maybe the problem is in `"dirname(__FILE__)"`? Isn't it expecting from me to have opennote in some subfolder on my main domain, and then, assuming that "note.fswitch.cz" is not subdomain but simply subfolder under main domain? From what i can see, maybe the solution is substr-ing the name of subdomain from the main calling path, but i dont know how... And yes, i downloaded the last version, last commit [32b3873a32](https://github.com/FoxUSA/OpenNote/commit/32b3873a325b4cd27ec1c4d4f352e1d343149a8c) This is very weird... :D
Author
Owner

@JLiscom commented on GitHub (Feb 10, 2014):

typeinclude_once dirname(__FILE__)."./modules/login/Authenticater.php"; to include_once dirname(__FILE__)."/./modules/login/Authenticater.php";.
What OS are you running apache on?

<!-- gh-comment-id:34594917 --> @JLiscom commented on GitHub (Feb 10, 2014): type`include_once dirname(__FILE__)."./modules/login/Authenticater.php";` to `include_once dirname(__FILE__)."/./modules/login/Authenticater.php";`. What OS are you running apache on?
Author
Owner

@JLiscom commented on GitHub (Apr 3, 2014):

Closed due to inactivity

<!-- gh-comment-id:39508699 --> @JLiscom commented on GitHub (Apr 3, 2014): Closed due to inactivity
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OpenNote-JLiscom#28
No description provided.