Jump to content
  • 0

FluxCP Installation / Running Issues on CleanURLs


monkoto

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/31/21
  • Last Seen:  

Hey all,

I'm using the git rathena/FluxCP for files. Most of these problems are divided apart between cleanurls enabled or disabled.

The first problem is email. I get errors using the gamemaster admin panel with the "No one" option (I was assuming this was to test if things were working, is that not what it is for?) but it works if I ask to reset a password or create a new user or if I select a different radio dial option in admin (works = the server sends an email and I get it on the configured accounts) so... I'm not sure? Seems like this the only option that causes breakage, either an error 500 with cleanurls disabled or the following with cleanurls enabled:

Notice: Undefined variable: sth in /var/www/html/modules/mail/index.php on line 37

Fatal error: Uncaught Error: Call to a member function execute() on null in /var/www/html/modules/mail/index.php:37 Stack trace: #0 /var/www/html/lib/Flux/Template.php(375): include() #1 /var/www/html/lib/Flux/Dispatcher.php(170): Flux_Template->render() #2 /var/www/html/index.php(169): Flux_Dispatcher->dispatch(Array) #3 {main} thrown in /var/www/html/modules/mail/index.php on line 37

If I setup the encoding section, ICONV throws a massive slew of errors because:

Notice: iconv(): Wrong charset, conversion from `utf8mb4_unicode_ci' to `utf8' is not allowed in /var/www/rosrv/lib/Flux/DataObject.php on line 65

The database is utf8mb4_unicode_ci, and I tried to set up the iconv with utf8 due to the comments in the application and server php files. Adding the escapes back to "Encoding" removes the errors, but I'm not sure about any unintended consequences that might result.

I noticed while doing all this that some of the database tables for FluxCP are MyISAM vice InnoDB, does it need to remain like that? I did the rAthena conversion of the server tables so that they went from MyISAM to InnoDB. It seems like some of them are setup to use InnoDB unlike the server which initially everything was on MyISAM so I didn't want to edit without asking.

image.png.fffae4e659447a969ef865cfce665cd5.png

Next, the Downloads and Rules pages have an error for Missing Action (with debug = true):

Missing Action!
Module: pages, Action: content&path=downloads

Request URI: /pages/content&path=downloads/

File system location: /var/www/html/modules/pages/content&path=downloads.php

With debug = false

	
Page Not Found
The page you have requested was not found on our server. Please check the address and make sure it is correct, and try again.

/pages/content&path=downloads/

This only happens when cleanurls are setup. Without cleanurls these two pages work fine.

The Character and Cash Shop links don't work (if debug is set to true) but that is corrected by merge #275 (verified on my install) and the add news page is missing the TinyMCE editor (regardless of cleanurls setting), but there were other threads out there (1,2) about that so I'm leaving them out of mine.

 

Can someone provide guidance on the above?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3123
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

The first thing I would do is remove the .php from your download page URI. FluxCP is trying to interpret that as an actual file, which doesn't exist because the page data is pulled from the cp_cmspages table in your database.

For the mail issue, i'll look into it. It's been about 4 years since i've touched that code, so who knows what I was trying to accomplish with the "No one" option. It would make sense for it to be a "catch-all" scenario where you don't send to any emails (kinda like a "select from this list" you see as the first option in most drop-downs).

For the database messages, it should just work out of the box (after configuring your config.php and servers.php files). You shouldn't need to do any converting between engines at all - so this has confused me slightly. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1530
  • Reputation:   234
  • Joined:  08/03/12
  • Last Seen:  

10 hours ago, monkoto said:

Hey all,

I'm using the git rathena/FluxCP for files. Most of these problems are divided apart between cleanurls enabled or disabled.

The first problem is email. I get errors using the gamemaster admin panel with the "No one" option (I was assuming this was to test if things were working, is that not what it is for?) but it works if I ask to reset a password or create a new user or if I select a different radio dial option in admin (works = the server sends an email and I get it on the configured accounts) so... I'm not sure? Seems like this the only option that causes breakage, either an error 500 with cleanurls disabled or the following with cleanurls enabled:


Notice: Undefined variable: sth in /var/www/html/modules/mail/index.php on line 37

Fatal error: Uncaught Error: Call to a member function execute() on null in /var/www/html/modules/mail/index.php:37 Stack trace: #0 /var/www/html/lib/Flux/Template.php(375): include() #1 /var/www/html/lib/Flux/Dispatcher.php(170): Flux_Template->render() #2 /var/www/html/index.php(169): Flux_Dispatcher->dispatch(Array) #3 {main} thrown in /var/www/html/modules/mail/index.php on line 37

If I setup the encoding section, ICONV throws a massive slew of errors because:


Notice: iconv(): Wrong charset, conversion from `utf8mb4_unicode_ci' to `utf8' is not allowed in /var/www/rosrv/lib/Flux/DataObject.php on line 65

The database is utf8mb4_unicode_ci, and I tried to set up the iconv with utf8 due to the comments in the application and server php files. Adding the escapes back to "Encoding" removes the errors, but I'm not sure about any unintended consequences that might result.

I noticed while doing all this that some of the database tables for FluxCP are MyISAM vice InnoDB, does it need to remain like that? I did the rAthena conversion of the server tables so that they went from MyISAM to InnoDB. It seems like some of them are setup to use InnoDB unlike the server which initially everything was on MyISAM so I didn't want to edit without asking.

image.png.fffae4e659447a969ef865cfce665cd5.png

Next, the Downloads and Rules pages have an error for Missing Action (with debug = true):


Missing Action!
Module: pages, Action: content&path=downloads

Request URI: /pages/content&path=downloads/

File system location: /var/www/html/modules/pages/content&path=downloads.php

With debug = false


	
Page Not Found
The page you have requested was not found on our server. Please check the address and make sure it is correct, and try again.

/pages/content&path=downloads/

This only happens when cleanurls are setup. Without cleanurls these two pages work fine.

The Character and Cash Shop links don't work (if debug is set to true) but that is corrected by merge #275 (verified on my install) and the add news page is missing the TinyMCE editor (regardless of cleanurls setting), but there were other threads out there (1,2) about that so I'm leaving them out of mine.

 

Can someone provide guidance on the above?

Go to domain.com/?module=pages and u can create page there. So just create page with path downloads.

And also u can check this PR since this is the support for new formats db (YML) : https://github.com/rathena/FluxCP/pull/275

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/31/21
  • Last Seen:  

10 hours ago, Akkarin said:

The first thing I would do is remove the .php from your download page URI. FluxCP is trying to interpret that as an actual file, which doesn't exist because the page data is pulled from the cp_cmspages table in your database.

For the mail issue, i'll look into it. It's been about 4 years since i've touched that code, so who knows what I was trying to accomplish with the "No one" option. It would make sense for it to be a "catch-all" scenario where you don't send to any emails (kinda like a "select from this list" you see as the first option in most drop-downs).

For the database messages, it should just work out of the box (after configuring your config.php and servers.php files). You shouldn't need to do any converting between engines at all - so this has confused me slightly. 

@Akkarin Thanks for the reply.

I don't see the .php in the URI, unless I have debug on true (with cleanurls on true as well - cleanurls=false, no issues so debug=true/false doesn't matter). That's when I get the error message about a php file. With debug on false, I get the Page Not Found error above (error matches uri). The actual URI looks like domain.com/pages/content&path=downloads and F12 doesn't provide anything useful (just the 404).

image.thumb.png.1e133ca03edeb19b185dcd96354f2b14.png

With debug=true, I get the Missing Action! message above, and code turns into 200: 

image.thumb.png.5155745961ae40f250aa474827db848d.png

I changed install directory with the reinstall but otherwise no differences on setup from OP. The database has the original setup, again, it only fails to work with cleanurls=true; with cleanurls=false I get no errors.

image.png.d3e8b5a37503cb9604cd05e487a2c660.png

I'm just using the included *.htaccess file, with the following settings:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|gif|jpg|png|css|pdf|swf|flv)$ index.php [QSA]

This is running on a Debian 10 system (PVE kernel because LXC container) with Apache 2.4.38/PHP 7.3.27. Do I need to note that the news works fine? There are no problems with displaying main/news pages with cleanurls=true.

 

For the database, I wasn't sure and wanted to ask. I have mine setup for utf8mb4 by default, not utf8, which shouldn't cause any problems I agree it was just how I read the config files made me think I should apply it. I disabled it by re-commenting the encode lines and haven't noticed anything else.

Is it okay to change all the tables to InnoDB or should I leave them as MyISAM for FluxCP?

@Chaos92 Yes, I'm aware of #275, I included it above and I am using the merge so my database works.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3123
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

13 hours ago, monkoto said:

With debug=true, I get the Missing Action! message above, and code turns into 200: 

image.thumb.png.5155745961ae40f250aa474827db848d.png

Ah, I was referring to this. FluxCP is looking for a file called "content&path=downloads.php" and I'm not really sure why, as it get's the page content for that address from content.php. Something odd is definitely occurring for you but I'm not sure what to suggest.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/31/21
  • Last Seen:  

Well, the suspicion for me would be something in rewrite. With cleanurls = false, everything works so I'm not convinced it is an issue with FluxCP, but I'm still not sure what is driving the behaviour. A new discovery, you can view the pages if you use the admin menu here:

image.png.d2ee6d8c6c2837cd15807a112a4b6c80.png

Which provides a URI like this: domain.com/pages/content/?path=rules

image.thumb.png.ad718e25c3330ba4dcf66e4b2215d4aa.png

So for some reason, the link provided by clicking in Rules/Download on the left menu is broken, but the admin view page link is not. Is that FluxCP or rewrite?

 

 

Edit2: Separating this out, not a rewrite issue:

Another oddity I noticed; favicon works with cleanurls = false, but vanishes with cleanurls = true.

Edit: can confirm the favicon going away is based on rewrite (cleanurls = true), if you click on the header picture it sends you to BASEURL, whereas clicking on MainMenu->Home sends you to BASEURL/main/ and console shows 404 for favicon at a URI of BASEURL/main/favicon.ico (or any other module not defined as BASEURL) which makes sense because the file is located at BASEURL not /main/, so makes me think the page thing is too; the confusing part to me then is why the link from admin panel will show me the rules page but the main menu link will not.

Edit2: The favicon is caused by themes. The href for favicon is to point at current directory instead of root.

image.png.eda782ba6670c4fc5fbd9029b7bcea63.png

This works fine with cleanurls = false, but does not work with cleanurls = true since our URI changes to a folder-like structure. I don't see why href can't always be "/favicon.ico" by default (remove the dot and force root path) in these files, since the favicon should (by default from checkout in git) be located at root path.

Edited by monkoto
Additional information
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/31/21
  • Last Seen:  

@Akkarin, can you lead me to where in the code the difference between the menu url and the admin url is generated for pages? I've done as much experimentation with rewrites as I know how with no avail, but I can't seem to find the references for where the links are generated in the menus to test that avenue. The admin menu presents the correct URL, so I'm wondering what difference may exist between it and the main menu / sidebar.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3123
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

On 4/7/2021 at 8:01 PM, monkoto said:

@Akkarin, can you lead me to where in the code the difference between the menu url and the admin url is generated for pages? I've done as much experimentation with rewrites as I know how with no avail, but I can't seem to find the references for where the links are generated in the menus to test that avenue. The admin menu presents the correct URL, so I'm wondering what difference may exist between it and the main menu / sidebar.

It depends on the theme you're using. If it's an older theme that was built before the new FluxCP theme system, then it'll be broke.

The default and bootstrap themes that are included with FluxCP has the menus built from themes/<theme_name>/main/sidebar.php or navbar.php respectively.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/31/21
  • Last Seen:  

I've tried it with both the default and bootstrap themes and gotten the same behaviour. I have not branched out to any other themes yet since I'm still getting the basic functionality figured out.

image.png.afff3507cae5651a0e768ae4f1007844.png

Generally speaking, I need to figure out why the link from #1 does not match the link from #2. #1 provides a URI like this 

domain.com/pages/content/?path=rules

whereas #2 provides a URI like this 

domain.com/pages/content&path=rules

#1 works, #2 does not. All of this assuming that cleanurls = true.

I assume that #1 is the intended URI to be generated (since it works), so for whatever reason the menu generated by the sidebar is different from the menu generated by the CMS in admin.

Link to comment
Share on other sites

×
×
  • Create New...