Lighttpd + Multiple Servers

5 replies [Last post]
Joined: 06/03/2009
Points: 6

Hi All,

I've been dying to try out Kaltura, but have a custom setup and wanted to know if anyone had pointers as to how I could get it working.

We have multiple "web heads", servers that just run incoming dynamic requests (php/perl) all of which run lighttpd. These all serve from a local drive that's synchronized to the master file system every 30 seconds.

So, on the web heads, lighttpd servers from /var/www/html/www.domain.com
If any of the web heads need to write to a file for it to be replicated, they do so by writing to /media/dynamic/www.domain.com

I'm running into two issues here:

1) I have no mod_rewrite. It's easy enough for me to translate a htaccess file into lighttpd rules, but I can't seem to find the ones that apply.

2) How can I make KCE write to the /media/dynamic when it needs to modify files, but read files from the local copy? I tried replacing $root_dir in install/common.php with a hard-coded path ($root_dir = '/media/dynamic/www.domain.com';) and it will install and the install wizard reports that those files are writable.

When I do this, it installs fine, but then gets in a really whacky redirect loop that never resolves. Which leads to question three...

3) Does index.php in the root directory get replaced after install or does it always just have Location: /install/ redirect?

I also tried having the web heads serve directly from the master file system, but then it complains that it can't find FFMPEG, even though it's on all the servers and this error is not thrown when I modify $root_dir. (But the other problems make the install not work.)

Any tips would be greatly appreciated!

Cheers-
Austin

Joined: 02/22/2009
Points: 97

Hi,

Assuming you downloaded the kalturaCE_v1.01.tgz yesterday, please re-download and re-install.
We had a problem in the bundling and had to repack the package.

The index.php is not changing after installation.
The current version checks if kalturaCE is installed, and if it is it just displays a different file inside the install folder.

regarding the multiple heads - I can suggest you create a symbolic link from the real path of the head to the place where you want the files to be written, so the installation will work without manually changing the $root_dir.

About reading from a different path than writing - this is a good question which I suspect that without changes in the core will not be so easy to get.

Gonen

Joined: 06/03/2009
Points: 6

Hey Gonen,

Thanks for getting back to me. I'm experiencing the same problems as I was before after trying the new version.

Just to get rid of the multiple webheads/read+write locations, I decided to try and install on one of our dev machines.

The install works (still that Safari bug, javascript thinks one of the elements is empty and will never let you submit the last installation page), but I get the endless redirects. If I do: curl -vis http://kaltura.mycompany.org/index.php/kmc ... it returns a redirect to "Location: install/" which would make it go to "http://kaltura.mycompany.org/index.php/kmcinstall/" which points to "http://kaltura.mycompany.org/index.php/kmcinstall/install/" and so on and so on.

This behavior makes complete sense as index.php only has a header redirect in it.

Now, given that I've been doing "wget src.tgz | gunzip xvf src.tgz | tar xvf src.tar | mv src/* /path/to/root" I realized that it's skipping the .htaccess file in the base folder (which I had been looking for earlier). I'm going to convert these into a set of lighttpd rules (bleh @ Apache overhead for serious websites!) and I'll post them later.

Cheers-
Austin

Joined: 06/03/2009
Points: 6

Here's a simple php script to convert htaccess files into lighttpd url.rewrite-once rules: http://dev.austinheap.com/kaltura/htaccess2lighttpd-0.1.txt

Here's the Kaltura v1.01 htaccess converted into lighttpd land: http://dev.austinheap.com/kaltura/lighttpd-rewrites-kaltura-1.01.txt

Joined: 06/03/2009
Points: 6

What I posted above should theoretically work, but it doesn't. This is standard htaccess > lighttpd conversion.

Any other lighttpd power users want to chime in? Do any big video sites actually use Apache? (I mean, even YouTube uses lighttpd...)

Based on what I've read from the lighttpd forums, it seems they have little (oops, no?) tolerance for rewrites that patch "shitty" (I'm totally quoting the dev team) use of htaccess to fix "bad" (again a quote) PHP code that relies on RewriteRule.

Why aren't these rules hard coded into index.php? Seems silly to rely on the server for handling rewrites when you already have full control in the code... no?

Joined: 04/05/2009
Points: 42

hi,
Thanks for your comment and inputs.
please feel free to use the feature requests option in the issues queue. it is a convenient way for us to organize the scope of the next version.
I have already added a feature request for this issue, and we will consider better support for lighttpd for next version.
check it out here http://kaltura.org/support-lighttpd
Thanks
Ariel.