Trying to install on Cherokee/Lighttpd [SOLVED]

MaurizioB
Ssr. Bludit
Posts: 12
Joined: Mon Nov 09, 2015 12:59 am

Hello,
I wanted to test Bludit on my local machine before uploading online, and since I don't want apache for simple tests, I decided to try Cherokee, a small and light server.
Unfortunally I'm stuck after installing Bludit: I've been able to install it, but if I go to the admin login page I just can't access the administration. After I enter my id/pw it just shows me again the login page.
Cherokee works a little differently than apache, I also tried with lighttpd but I wasn't able to translate the rewrite rules.
I added a static content rule for the /bludit/themes directory, and that was what allowed me to install Bludit successfully (or, at least, I think so). I was able to set a default redirect rule, which internally translates ^/(.*)$ to /bludit/index.php, but I might be missing something.
I'm asking for help on the Cherokee irc channel, but didn't found a solution yet. Is there another rule I should add, maybe?

Thanks.

EDIT:
This rule suggested by Tak-MK should do the trick!

Code: Select all

url.rewrite-once = (
        ".*\.(txt)$" => "/",
)

url.rewrite-if-not-file  = (
        ".*\?(.*)" => "index.php?$1",
        "." => "index.php"
)
just change the paths if you don't have bludit in the website root, so "index.php" becomes "/bludit/index.php" and so on.
Last edited by MaurizioB on Tue Dec 29, 2015 6:21 am, edited 2 times in total.
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Which operating system do you use on your local machine? In can only test in a Windows environment. :-(
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

By the way: Is Cherokee still maintained? There is a commit on Github half a year ago, but the last stable release 1.2.103 has the date April 21, 2013, also the website shows © 2001-2013. The last entry on facebook is from January 2012, the last tweet on Twitter from October 2011.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
kaaleth
Master Bludit
Posts: 117
Joined: Sun Jun 14, 2015 9:55 am

Try wamp.
MaurizioB
Ssr. Bludit
Posts: 12
Joined: Mon Nov 09, 2015 12:59 am

Hi. I'm on Linux, so there could be some permission or path issues.
I just realized that cherokee has actually not been maintained a lot in the latest 2 years, so I might change to something more updated like lighttpd. The point is that I've some problems configuring it too. I tried to add a rule for mod_rewrite, but I still get problems.

This is what I set in the lighttpd.conf:
url.rewrite-once = ( "^/(.*)" => "/bludit/index.php$1" )
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

Hi MaurizioB,
for the moment I'm testing Bludit on Apache and Nginx, I will make the documentation for Lighttpd. The first problem here are the rewrite rules, if you found it please share :D

Nginx docs: http://docs.bludit.com/en/web-servers/nginx
MaurizioB
Ssr. Bludit
Posts: 12
Joined: Mon Nov 09, 2015 12:59 am

Ok, so far I was able to install Bludit correctly on lighttpd using this:

Code: Select all

url.rewrite-once = ( "^/bludit/themes/(.*)" => "$0",
                        "^/bludit/(.*)" => "/bludit/index.php?q=$1" )
But the problem remains: when I try to login in the admin page, it just shows me the login page.
This is the error.log when I try to access the admin area:

Code: Select all

2015-11-10 01:07:15: (mod_fastcgi.c.2695) FastCGI-stderr:  | Error occurred when trying validate the tokenCSRF. Token CSRF ID: aff086276a5c4d6b5a885595db5461d0aaecf5ea
2015-11-10 01:07:15: (mod_fastcgi.c.2695) FastCGI-stderr: Session::destroy | Session destroyed.
2015-11-10 01:07:15: (mod_fastcgi.c.2695) FastCGI-stderr: Login::isLogged | FingerPrint are differents. Session fingerPrint:  !== Current fingerPrint: 18af05a1aa5f4ce101acdbce15f8e397ed612504
2015-11-10 01:07:15: (mod_fastcgi.c.2695) FastCGI-stderr: Login::isLogged | FingerPrint are differents. Session fingerPrint:  !== Current fingerPrint: 18af05a1aa5f4ce101acdbce15f8e397ed612504
2015-11-10 01:07:15: (mod_fastcgi.c.2695) FastCGI-stderr: Login::isLogged | FingerPrint are differents. Session fingerPrint:  !== Current fingerPrint: 18af05a1aa5f4ce101acdbce15f8e397ed612504
2015-11-10 01:07:15: (mod_fastcgi.c.2695) FastCGI-stderr: Login::isLogged | FingerPrint are differents. Session fingerPrint:  !== Current fingerPrint: 18af05a1aa5f4ce101acdbce15f8e397ed612504
2015-11-10 01:07:15: (mod_fastcgi.c.2695) FastCGI-stderr: Login::isLogged | FingerPrint are differents. Session fingerPrint:  !== Current fingerPrint: 18af05a1aa5f4ce101acdbce15f8e397ed612504
2015-11-10 01:07:15: (mod_fastcgi.c.2695) FastCGI-stderr: Login::isLogged | FingerPrint are differents. Session fingerPrint:  !== Current fingerPrint: 18af05a1aa5f4ce101acdbce15f8e397ed612504
MaurizioB
Ssr. Bludit
Posts: 12
Joined: Mon Nov 09, 2015 12:59 am

Ok, I managed it.
It turns out I was using the wrong rule, after understanding what the .htaccess and nginx rules were about (let index.php process the request if the requested file doesn't exists) I removed the rewrite-once rule and used this one instead:

Code: Select all

url.rewrite-if-not-file = ( "^/bludit/(.*)" => "/bludit/index.php?q=$1" )
After restarting lighttpd I was finally able to make Bludit work. And it rocks ;-)
You might want to add it to the documentation, maybe. I'm trying to make it work for Cherokee too, but since I don't really know it I've not been successful yet.

Thank you
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

MaurizioB wrote:Ok, I managed it.
It turns out I was using the wrong rule, after understanding what the .htaccess and nginx rules were about (let index.php process the request if the requested file doesn't exists) I removed the rewrite-once rule and used this one instead:

Code: Select all

url.rewrite-if-not-file = ( "^/bludit/(.*)" => "/bludit/index.php?q=$1" )
After restarting lighttpd I was finally able to make Bludit work. And it rocks ;-)
You might want to add it to the documentation, maybe. I'm trying to make it work for Cherokee too, but since I don't really know it I've not been successful yet.

Thank you
Nice, I will install a server with lighttpd and test it.
Thanks
User avatar
Tak-MK
Jr. Bludit
Posts: 1
Joined: Wed Nov 25, 2015 3:59 pm

Hi! Maybe I'm a bit late, but I'm using these rules and it works :D

Code: Select all

url.rewrite-once = (
        ".*\.(txt)$" => "/",
)

url.rewrite-if-not-file  = (
        ".*\?(.*)" => "index.php?$1",
        "." => "index.php"
)
Tested it on a FreeBSD 10.2 with Lighttpd 1.4.37 :D
Post Reply