Lighttpd - MySQL - PHP (cgi) - SUCCESS

nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2009-06-30 21:13

Successfully installed G3 (latest code from git as of about 1pm PST 6/30/2009) and uploaded pictures.

This is not a tutorial, period. Once I do this again and actually document the process I'll post on the wiki. Though it's not much different that on an Apache server other than one config change noted below.

Only real configuration change I needed to make to php was to set (assuming you have lighttpd working with php and mysql)

cgi.fix_pathinfo = 1

A fresh server, had to install all the related software....
Debian 5.0 Lenny

Everything I installed was just out of the repositories:
lighttpd
mysql-server
mysql-client
php5-cgi
imagemagick
php5-cgi
php5-mysql
php5-imagick
php5-gd
php5-json
php5-mcrypt

Since this is a fresh server, I haven't even moved my sites over yet. Once I do, I'll test out other stuff, like importing G2 and running through any module (well any module I'm interested in) available.

EDIT: getting an error 411 - length required when trying to move photos around in Options > Organize Album
will report back when I know more
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
m3lvm

Joined: 2009-06-17
Posts: 49
Posted: Wed, 2009-07-01 01:09

The Change you have commented on is standard for fast cgi in lighttpd.
The most important aspect of lighttpd is that its faster than Apache and eaiser to configure.
Both my linux server and windows server are running lighttpd.
one word of caution make sure you understand how to secure the web root as htaccess is not an option. but chmod as you know is the way in linux
This is for a window install....

Quote:
url.access-deny = ( "~", "::$DATA", ".inc", "config.php","e107_config.php",".htaccess","boot.ini","MSDOS.SYS","IO.SYS","NTDETECT.COM","khq","ntldr","System Volume Information/","RECYCLER/",)

The only difference for virtual Hosts in linux is the path of you hosts web folder.
What I tend to do is keep the default webroot for the server as is with phpmyadmin installed there, and v-host to a different harddrive

Quote:
$HTTP["host"] == "www.mywebsite.com" {

server.document-root = "E:/webroot/myroot/"
}

As you can see in this example it is much easier to configure the server.
The only anoying aspect of lighttpd it will give no real warning especially in window if the server fails to start up. nor will it give you any indication of what has stopped it working.
Also look at Hiawatha for another light weight server.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-07-02 18:18

Thanks for the suggestion on the web server, I'll check it out.

Open Source - Check
Maturity - looks like it's been around for awhile and is still actively developed, though it looks like if Hugo get hits by a bus tomorrow, development will cease...
Support Community - hmmm my home town, which there are people 30 miles away who don't know it exists, is bigger...

I'll check it out, but I'm not getting the warm fuzzy from the tiny community standing behind it.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
dmizer

Joined: 2008-10-08
Posts: 40
Posted: Sat, 2009-07-04 07:18

I was able to install with lighttpd as well. I can add albums, but I cannot add photos. I get an "upload error: 400".

Upon attempting to change the permissions on the album, I get this error:

Quote:
Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to set AllowOverride FileInfo Options to fix this.

Looks like this needs a rewrite, but I haven't a clue as to how to craft one for Lighttpd. Any insight on that one?

Server is Ubuntu 8.04 Using Gallery 3.0 beta 1

Took me a few days to figure out that I have to use the "update translations" function in the maintenance tab in order to make my language choices functional.

Edit:
I also get the 411 - Length Required error when attempting to upload from the server.

 
m3lvm

Joined: 2009-06-17
Posts: 49
Posted: Sat, 2009-07-04 10:15

Have a look at the php config there are a nimber settings that need to be changed :

Quote:
memory_limit = 512M ; Maximum amount of memory a script may consume (16MB)

As you can see I have a high memory limit.

Also you have to change this;

Quote:
upload_max_filesize = 20M ; Maximum file size allowed to be uploaded
; Determines the size of the realpath cache to be used by PHP. This value should
; be increased on systems where PHP opens many files to reflect the quantity of
; the file operations performed.
realpath_cache_size=512M

If these settings are too low then the php will throw out an error
Also make sure you have the

Quote:
extension=php_gd2.dll

is active

The allowoverides is not an issue in Lighttpd as this statment is one for Apache and its htaccess.
the server security is totally different for lighttpd.
you use the url.access-deny statment listed in this topic to restrict access to important files.
in lighttpd everything is allowed until you deny access.

 
coops
coops's picture

Joined: 2002-10-31
Posts: 40
Posted: Sat, 2009-08-01 12:42
dmizer wrote:
I was able to install with lighttpd as well. I can add albums, but I cannot add photos. I get an "upload error: 400"

Do you find a solution to this as I'm having the same issues?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2009-08-01 16:15

It just worked for me :) Are you using the latest code:
http://codex.gallery2.org/Gallery3:Upgrading

Check gallery2/var/logs

Check your error and access logs, probably at /var/log/lighttpd/error.log and /var/log/lighttpd/access.log

Error 400 = Bad Request: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
usef

Joined: 2010-06-14
Posts: 4
Posted: Mon, 2010-06-14 14:32

Hi nivekiam,
are you using lighttpd now, with RC1?

I'm not having success in uploading photos...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-06-14 15:30

No, only Apache right now. I don't have any time to spend troubleshooting something else right now.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
dmizer

Joined: 2008-10-08
Posts: 40
Posted: Mon, 2010-08-16 03:14

Have Gallery 3.0 RC2 working perfectly in lighttpd with the information in this thread.

Server is Ubuntu 10.04 LTS

Able to add and remove photos and albums. Later this evening I will test the gallery2 import.

Unrelated to lighttpd, I can't begin to tell you how wonderful it is to be able to include multilingual translations with just a few clicks.

 
dragof

Joined: 2010-10-11
Posts: 2
Posted: Mon, 2010-10-11 00:56

Have anyone tried tried to restrict access to certain albums? Does not seem to work with lighttpd. Tried various changes in conf. Env. Gallery 3, Ubuntu 10.04 LTS, Lighttpd the latest & greatest :) Rest is working just fine.

Message from gallery 3 is:

Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable mod_rewrite and set AllowOverride FileInfo Options to fix this.[i]

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-10-11 01:23

No it doesn't and will probably never be a supported configuration.

You'll probably always get that info unless you figure out some way to fool G3's url rewrite check under Lighttpd.

To force Gallery to run everything through it's file proxy, you'll need to manually create a rewrite rule in Lighttd's config. Sorry, but I don't know what you'd need to put in there. I've only done enough research to get a good idea that it'll be a PITA to run Lighttd for my low traffic sites. I have no need at this time to run something more efficient than Apache.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
dragof

Joined: 2010-10-11
Posts: 2
Posted: Mon, 2010-10-11 12:05

Thank you.