SPPayne / webcomical_cms

An open-source CMS tailored for webcomic authors.
The Unlicense
1 stars 0 forks source link

Login page not found after install #1

Closed catter-fly closed 3 years ago

catter-fly commented 3 years ago

Installed perfectly cleanly, but the immediate redirected page (site.com/auth/login) comes up as File Not Found? Navigating to site.com/application/auth/login gives the same message. What, uh. What now?

SPPayne commented 3 years ago

Lummy been a while since I worked on this! Is the .htaccess file present in the root and has mod_rewrite been enabled on the server? Off the top of my head maybe that's why it's not routing correctly.

catter-fly commented 3 years ago

Yep, mod_rewrite is enabled (I don't have terminal access, so that was fun to work out), and I realized that RewriteBase / needed to be RewriteBase /subdomain_this_is_on/ and now I've got a different error page! I'm getting both a AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. in the error log and a generic 500 on the page.

SPPayne commented 3 years ago

Hmm that sounds like it's stuck in a redirect loop. I'm not sure I tested it installing to a subdirectory so I wonder if something's been coded to expect the root directory (could genuinely be the case I didn't account for it). Unfortunately I might not get time to look at it within the next 24 hours as I've got something on but I will attempt to test this week and put a fix on as required. Apologies!

SPPayne commented 3 years ago

Sorry for comment spam, if you change the following line in .htaccess:

SetEnv CI_ENV production

To instead be...

SetEnv CI_ENV development

I'd be interested to know if any errors popped up when refreshing!

catter-fly commented 3 years ago

Changed to development, but nothing different. It's no real rush! I'm slowly parsing through files that reference auth (or rewritebase? hmm 🤔 ) to see if it's obvious, but php is not my forte so I might miss it the first go-around....

SPPayne commented 3 years ago

So I've created a new virtual host entry on my computer (http://dev.test-comic.co.uk - not a real website I don't think) and tried installing to a subdirectory (http://dev.test-comic.co.uk/comic/) and everything is just broken! I'm actually surprised it completed installation, truth be told.

Apparently I coded the entire damn thing to assume it was being installed to the root folder of a website, bit of an oversight on my part as I didn't intend that at all. I don't see why it wouldn't work in a subdirectory, I just need to update pretty much most of the views and some of the controllers to rely on base_url() (which gets set as part of the install).

Please bear with me while I go through all the files and update them; I'll want to test on one of my own webcomics too to make sure nothing breaks.

catter-fly commented 3 years ago

Pfhahahah, incredible. I guess there were just enough references to get the home page up, I'm impressed and amused at the accidental cheekiness.

Take your time! I'm not in a rush, I just very much want to not use wp haha. I'm excited though!! I've been looking for a cms that's both in-depth but coded Just Accessible Enough for me to learn and brute force fidget with if I need to. :3

SPPayne commented 3 years ago

Status update, I know you said not to rush but I'd like to get this fixed! Just finding it difficult to find time to work on it. There's also a session issue in Codeigniter that needs fixing (I know what needs doing) and I might as well upgrade the CodeIgniter framework while I'm at it. I'll try and find a few hours in evenings this week (GMT), hopefully have most of it resolved by the end of the week.

SPPayne commented 3 years ago

Good progress today, most of the admin panel has been updated. Hopefully I'll get some time later this week to blitz the rest but we're halfway there.

catter-fly commented 3 years ago

i'm bongo-catting with pompoms excitedly over here!

SPPayne commented 3 years ago

My to do list:

So in terms of this specific issue I'm fairly confident that it's mostly fixed, however I'm going to recommend waiting until I've fixed the session cookies warning the app currently generates. Hoping to blitz the last of this tomorrow and test on one of my own sites but I've already gone a week longer than I thought so let's aim for the end of this week!

SPPayne commented 3 years ago

Apologies it's taken so long to finish this, I've been very busy with work!

I've implemented the fix I wanted to regarding the "samesite" cookies issue, I recommend utilising PHP 7.3 or above if possible to be safe but the app should work in 7.2 and previous.

On that, it's an emphatic "should" work; I'd love to say I've thoroughly tested but I have not! I just don't have the time currently unfortunately. I will need to upgrade my own webcomics at some point so if I discover that I've borked something when that happens, I'll implement a fix or five. Otherwise, please do feel free to report any oddities you find and I'll deal with them when I can.

Thanks for reporting the original issue, have a good one.

catter-fly commented 3 years ago

Sup, sorry it took a bit to get back to you (times are wild, yikes), and I want to stress that I'm in no rush. I reinstalled webcomical and made it all the way through the install to be met with [http://subdomain.sitename.net/auth/login] and a single line reading File not found. I have zero idea what's wrong here and would love if you had advice? If it turns out I'm just a whole lemon I'll understand haha. tysm

SPPayne commented 3 years ago

Hmm I'll see if I can do a test run later!

Out of interest are you still installing to a subdirectory (e.g. http://subdomain.sitename.net/comic/ )? If so you'll need to set the base URL to include /comic/ so the login URL should redirect to http://subdomain.sitename.net/comic/auth/login

SPPayne commented 3 years ago

Okay so I took a fresh copy of the app off of Github and did a test installation on my virtual host local dev environ for installing it to the root at http://dev.test-comic.co.uk/ and it redirected to http://dev.test-comic.co.uk/auth/login after installation. Seems to login fine and the like.

Then to be safe I tried installing it to http://dev.test-comic.co.uk/comic/ and it installed and redirected successfully to http://dev.test-comic.co.uk/comic/auth/login after, which means I'm a bit stumped unfortunately!

All I can suggest is the following:

I'm really sorry I'm not able to replicate the problem!