Wedge

Public area => The Pub => Topic started by: sokha on June 30th, 2011, 02:27 PM

Title: Wedge on lighttpd or nginx
Post by: sokha on June 30th, 2011, 02:27 PM
I guess wedge will sooner or later be in public. I know many people use apache webserver but I prefer to use lighttpd instead. As I read in the FAQ(http://wedge.org/pub/faq/), it says:
Quote
Server side:

PHP 5.1.2 or higher, 5.2 or higher recommended
MySQL 4.1.2 or higher, 5.0 or higher recommended
GD2 graphic library for PHP
I would like to ask will wedge work 100% on lighttpd?
Title: Re: Wedge on lighttpd or nginx
Post by: Arantor on June 30th, 2011, 03:53 PM
lighttpd, yes, seeing how it is intended to be 100% compatible with Apache. Have they fixed the ridiculously crippling memory leaks yet?

nginx is a different story altogether, and it's possible the pretty URLs code will need tweaking to work on it.
Title: Re: Wedge on lighttpd or nginx
Post by: Nao on June 30th, 2011, 04:48 PM
Our pretty URLs shouldn't need much work. It's just a matter of changing one line basically... And I'm sure it has some suitable replacement for it ;)
Title: Re: Wedge on lighttpd or nginx
Post by: Arantor on June 30th, 2011, 05:05 PM
That's not what I was thinking of. nginx doesn't use .htaccess files AT ALL. The entire way of setting up routing is different.
Title: Re: Wedge on lighttpd or nginx
Post by: CJ Jackson on June 30th, 2011, 05:17 PM
As for IIS7, it has url rewrite and web.config, also it has a converter that convert mod-rewrite to url rewrite rules, so it should work on IIS7 with no problem.
Title: Re: Wedge on lighttpd or nginx
Post by: sokha on July 8th, 2011, 11:53 AM
Since I am not php coder, I have a question. Is it possible to handle the fancy URL in php code instead of .htaccess or in webserver?
Title: Re: Wedge on lighttpd or nginx
Post by: Arantor on July 8th, 2011, 12:47 PM
No.

The .htaccess file is the part that handles the fancy URL and passes it to PHP.

You can, on some configurations, get around it by constructing URLs in the form of index.php/rest-of-link/whatever but it's ugly and unreliable.
Title: Re: Wedge on lighttpd or nginx
Post by: CJ Jackson on July 8th, 2011, 01:12 PM
Quote from Arantor on July 8th, 2011, 12:47 PM
The .htaccess file is the part that handles the fancy URL and passes it to PHP.
Actually it's the Apache module called "mod_rewrite" that does that, all .htaccess does is store the configurations for Apache and it modules (including "mod_rewrite") per directory.  :eheh:

Same applies with IIS, URL Rewrite and web.config.
Title: Re: Wedge on lighttpd or nginx
Post by: Nao on July 8th, 2011, 01:32 PM
Quote from Arantor on July 8th, 2011, 12:47 PM
No.
I'd say yes, actually... You'll still need to edit .htaccess or httpd.conf once, but once it's done it's done.
Just redirect all missing files to index.php, either through ErrorDocument 404 (very bad idea since it fills the error log instead of the access log), or a rewrite rule on -f and -d parameters (missing file/folder).
Wedge comes with its own pre-made .htaccess with includes these for our pretty url implementation.
Title: Re: Wedge on lighttpd or nginx
Post by: Arantor on July 8th, 2011, 02:10 PM
Quote from CJ Jackson on July 8th, 2011, 01:12 PM
Quote from Arantor on July 8th, 2011, 12:47 PM
The .htaccess file is the part that handles the fancy URL and passes it to PHP.
Actually it's the Apache module called "mod_rewrite" that does that, all .htaccess does is store the configurations for Apache and it modules (including "mod_rewrite") per directory.  :eheh:

Same applies with IIS, URL Rewrite and web.config.
Yes, I know that. I was keeping the answer as straightforward as possible.
Quote
I'd say yes, actually... You'll still need to edit .htaccess or httpd.conf once
Then the answer IS no. The question asked was whether it could be done without .htaccess, which other than the index.php/url structure, pretty URLs cannot be done *just* in PHP, it relies on the web server routing properly.
Title: Re: Wedge on lighttpd or nginx
Post by: Nao on July 8th, 2011, 02:50 PM
I was just answering to his question in case he phrased it badly, i.e. he wanted to know if new URL schemes could be added without rewriting the htaccess itself (since it requires some prior knowledge). In PHP at least you can do without regex, even if it's strongly recommended to use them.
Title: Re: Wedge on lighttpd or nginx
Post by: Arantor on July 8th, 2011, 02:53 PM
Hmm, well, I've come to the conclusion of assuming the lowest common denominator as far as anyone is concerned these days: if someone is interested in the finer points, they'll probably ask in a way that suggests it - while if someone asks a broad question, they probably don't want details.

Yeah, it's nice that it's extensible without having to be complicated in terms of editing the htaccess file now.
Title: Re: Wedge on lighttpd or nginx
Post by: sokha on July 9th, 2011, 12:45 AM
Quote from CJ Jackson on July 8th, 2011, 01:12 PM
Quote from Arantor on July 8th, 2011, 12:47 PM
The .htaccess file is the part that handles the fancy URL and passes it to PHP.
Actually it's the Apache module called "mod_rewrite" that does that, all .htaccess does is store the configurations for Apache and it modules (including "mod_rewrite") per directory.  :eheh:
I ever knew and work with .htaccess of apache for a while. Yes, .htaccess work only with apache as far as I know.
Quote from Nao/Gilles on July 8th, 2011, 01:32 PM
Quote from Arantor on July 8th, 2011, 12:47 PM
No.
I'd say yes, actually... You'll still need to edit .htaccess or httpd.conf once, but once it's done it's done.
Just redirect all missing files to index.php, either through ErrorDocument 404 (very bad idea since it fills the error log instead of the access log), or a rewrite rule on -f and -d parameters (missing file/folder).
Yes, this is what I was thinking.
Quote from Nao/Gilles on July 8th, 2011, 01:32 PM
Quote from Arantor on July 8th, 2011, 12:47 PM
Wedge comes with its own pre-made .htaccess with includes these for our pretty url implementation.
I ever used apache2 before. At my site, there are plenty files to download and stream (audio). Before, apache always ate all of my server CPU and memory. I can't figure out how to tweak it (I used mod_php). Since it is hard to optimize, then I switched to lighttpd. It works perfectly as I need.
Title: Re: Wedge on lighttpd or nginx
Post by: Nao on July 9th, 2011, 01:16 AM
So, what did I win? :eheh:
Title: Re: Wedge on lighttpd or nginx
Post by: [Unknown] on July 9th, 2011, 08:31 AM
It's a common configuration to have all non-existent URLs forwarded to PHP.  I know that lighttpd also supports X-Sendfile, so technically I guess you could forward ALL requests to PHP even.

Although this does require configuration, basically most other PHP packages require it too, so it doesn't seem like a hefty requirement.  Falling back to pathinfo (index.php/xyz) is easy enough, too.

Note that many nginx and lighttpd servers are configured to disallow pathinfo requests because of some gotchas in configuring them with PHP.  There are correct ways to configure them with pathinfo working, but many people don't do this.  So, pathinfo actually becomes the less universal solution.

-[Unknown]
Title: Re: Wedge on lighttpd or nginx
Post by: Nao on July 9th, 2011, 09:37 AM
And Wedge got rid of pathinfo :)