Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
sHagen
Topic Author
Posts: 19
Joined: 13 Aug 2016, 19:02

Rewrite rules for the lighttpd webserver

15 Aug 2016, 05:05

Hello,

I deployed imagevue X3 on a lighttpd webserver with the following rewrite rules:
Code
url.access-deny = ( ".(txt|yml)$" )
url.rewrite-once = (
    "^/$" => "/index.php?/wedding/",
    "^/app/" => "/index.php",
    "^/panel/(.*)" => "/panel/$1",
    "^/check/(.*)" => "/check/$1",
    "^/render/(.*)$" => "/app/parsers/slir/index.php?/$1/",
    "^/public/(.*)" => "/public/$1",
    "^/content/(.*)" => "/content/$1",
    "^/(.+)\.(html|json|xml|atom|rss|rdf|txt)$" => "/index.php?/$1",
    "^/(.*)/$" => "/index.php?/$1/",
    "^/(.*)$" => "/index.php?/$1/"
)
There are a couple of issues I was not able to resolve yet.
  • The first rewirte rule forwards to the "homepage", which is /wedding/ in my case. I didn't find a setting in Imagevue X3 to do this automatically. I'm sure it's there.
  • On a brand new install, the diagnostics in Imagevue X3 is killing my php-fpm process entirely. I have to first start up without rewirte rules, go to the panel, deactivate diagnostics, activate the rewrite rules and then everything works just fine.
I'm unsure about....
Code
"^/app/" => "/index.php",
This seems to be used for the email process, which is currently not working in this setup.
I'm also not sure about /public/* and /check/* as I have not seen any links using them.

Related help resources I used: I have trouble to decode the apache rewrite rules. I think it would be great if we could assemble some sort of documentation about how the rewrite should work. The various admins usually know their server software and then they can implement it without learning the apache ruleset first.

Best Regards,
Stefan
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Rewrite rules for the lighttpd webserver

15 Aug 2016, 06:52

sHagen wrote:Hello,

I deployed imagevue X3 on a lighttpd webserver with the following rewrite rules:

I have trouble to decode the apache rewrite rules. I think it would be great if we could assemble some sort of documentation about how the rewrite should work. The various admins usually know their server software and then they can implement it without learning the apache ruleset first.
Generally speaking, this is documentation we need to catch up on at some point. I can't give clear answers specifically about lighttpd unfortunately. We are still busy getting out the new website, and 99% of our users are on standard shared Apache servers.

I am curious, is this your own server? And if so, is this also your server for live production websites?
sHagen wrote:The first rewirte rule forwards to the "homepage", which is /wedding/ in my case. I didn't find a setting in Imagevue X3 to do this automatically. I'm sure it's there.
Really not sure what you are trying to do here. Your home page should always be / INDEX (root domain), or the root of the folder where you installed X3. If it's not, then why not just install X3 in a folder called /wedding/ in the first place, if that is your home page? It is not good practice to redirect like this, as it creates unnecessary requests, and provides robots (SEO) inaccurate data. Also, with the X3 ASSETS settings, you could load images from weddings into your actual index home page. What you are requesting, it to not have a home page at all, and instead redirect all requests to the homepage, to your wedding page.
sHagen wrote:On a brand new install, the diagnostics in Imagevue X3 is killing my php-fpm process entirely. I have to first start up without rewirte rules, go to the panel, deactivate diagnostics, activate the rewrite rules and then everything works just fine.
Can't say anything about this unfortunately. If you check app/x3.diagnostics.php, it is a very simple script that checks extensions, and creates a few cache folders if necessary. Not much we can rewrite in this code ... sounds like something server-specific.
sHagen wrote:I'm unsure about....
Code
"^/app/" => "/index.php",
This seems to be used for the email process, which is currently not working in this setup.
I'm also not sure about /public/* and /check/* as I have not seen any links using them.
I believe all rules mentioned above can be ignored/removed, as they are part of legacy methods. X3 makes direct requests to files in "public", so no need to include the rule for that ... It's just generally part of the idea that all your public assets should be contained within /public/ and a request to /image/somefile.jpg will check for /public/image/somefile.jpg if rule is enabled. Can't see that there are any rules for /check/ any longer, as this was a folder in a previous version of X3 ...
sHagen wrote:I have trouble to decode the apache rewrite rules. I think it would be great if we could assemble some sort of documentation about how the rewrite should work. The various admins usually know their server software and then they can implement it without learning the apache ruleset first.
Sure. Will get around to it as soon as we find time.
 
User avatar
sHagen
Topic Author
Posts: 19
Joined: 13 Aug 2016, 19:02

Re: Rewrite rules for the lighttpd webserver

15 Aug 2016, 08:16

mjau-mjau wrote: I am curious, is this your own server? And if so, is this also your server for live production websites?
Yes, this is my personal server. I use it mostly for playing around and I host a couple of websites for friends. Nothing critical, really.
mjau-mjau wrote: Your home page should always be / ...
Yes, this is the case. Unfortunately I deleted the start folder and now I'm not able to make X3 to respond to /. It just shows an 404 error. It's probably just an option I'm missing to find. X3 is installed on root level.

[EDIT: I figured it out! For some reason, I managed to delete the "1.index" folder. I was not able to recreated it in the panel. I have copied it back from the downloaded .zip file and now I have a folder with a little house next to it which represents the home page. Yeeeehaaa!]

[EDIT2: The 1.index folder can not be deleted from the tree. However, it can be deleted when you click on "content", then mark 1.index and click delete. Just fyi]
mjau-mjau wrote: > If you check app/x3.diagnostics.php ...
The php process just goes forever and never creates any output. I didn't debug it. I'll eventually look into this again and will post my findings (if any). I don't expect to run your software on an unsupported webserver without issues. But people are reading the forums and I wanted to write down my experience. Maybe it will help somebody.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Rewrite rules for the lighttpd webserver

24 Mar 2017, 02:30

Hi @sHagen. Did you ever have any success setting up X3 on lighttpd? I am currently looking into official X3 configurations for NGINX and lighttpd.