View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 20 posts ] 
Go to page 1, 2  Next

Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sat Dec 24, 2005 5:30 pm 
Offline
Joined: Thu Dec 15, 2005 3:03 pm
Posts: 33
I run a webserver using Lighttpd, and it seems to run a lot faster than Apache, especially at lightweight jobs, like MythWeb. So I decided to replace the bloated Apache with the super-fast Lighttpd. It is a very simple process, and takes only a few steps, so here it goes...
Quote:
1. Download the package (wget http://t0z.org/debian/lighttpd_1.4.8-1_i386.deb)
2. Install it (dpkg -i lighttpd_1.4.8-1_i386.deb)
3. Kill Apache so Lighttpd can have port 80. (/etc/init.d/apache stop)
4. Start Lighttpd to make sure everything is good. (/etc/init.d/lighttpd start)
5. If you can see the MythWeb main page, everything is good, so you can continue onward!
6. Now since Lighttpd uses FastCGI to communicate with PHP, we need to recompile PHP from the source so....
7. Download PHP (wget http://us3.php.net/get/php-4.4.1.tar.gz ... his/mirror)
8. Untar PHP (tar zxvf php-4.4.1.tar.gz)
9. Now for the fun of compiling from the source! (cd ./php-4.4.1/)
10. Compile PHP with FastCGI support (./configure --enable-fastcgi --enable-force-cgi-redirect --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-freetype-dir=/usr/lib --with-zlib-dir=/usr/lib) Then (make) and finally (make install)
11. See if PHP compiled right (php -v) It should say
Code:
PHP 4.4.1 (cgi-fcgi) (built: Dec 24 2005 16:47:23)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

12. Now that we have PHP with FastCGI working, we have to configure Lighttpd to use it. (mcedit /etc/lighttpd/lighttpd.conf and find where it says
Code:
##fastcgi module
, now uncomment everything in that section, as the defaults should fit this install) In the beginning of the file, you will have to also uncomment "mod_fastcgi".
13. Restart Lighttpd (/etc/init.d/lighttpd restart) and if it doesn't spit out any errors, you are now good to go!

That should be it, you have a barebones working Lighttpd webserver. More information on all the modules included with Lighttpd can be found at their site here. Please tell me if anything is wrong in the guide, its my first HowTo...


Last edited by Protoss on Sun Dec 25, 2005 5:05 pm, edited 2 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 24, 2005 5:51 pm 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
Nice!

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 24, 2005 8:43 pm 
Offline
Joined: Sun May 23, 2004 1:50 pm
Posts: 78
Location: Palmdale, CA
Excellent. Just did this in about 15 minutes. The only thing I would add was that I had to uncomment the line in /etc/lighttpd/lighttpd.conf:

server.modules = (

"mod_fastcgi",

In order to get it to use fcgi.

Nice work.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 01, 2006 4:06 pm 
Offline
Site Admin
Joined: Fri Oct 31, 2003 11:40 pm
Posts: 357
Location: Irvine, Ca
Cesman, this would be a "good thing" to do by default to begin an effort to reduce the size needed for KnoppMyth. What are your thoughts on this? I mean, you really don't have that much to do on keeping up with KnoppMyth, after all. :D


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 02, 2006 1:11 pm 
Offline
Joined: Wed Jul 21, 2004 7:09 pm
Posts: 71
Location: Mounds View, MN (burbs of MSP)
1) don't forget
Code:
update-rc.d -f apache remove

so apache doesn't restart on reboot

Otherwise great job! Mythweb is sooo much more responsive now

_________________
FRONTEND 1 - R5A16, Athlon 3000+, NVidia Motherboard, SB live, GeForce 5200, AA 9A60
FRONTEND 2 - R5A16, Athlon 2500+, Nvidia Motherboard, SB Live, GeForce 440MX, TV-OUT
BACKEND - R5A16, Althon 1700+, Nvidia MB, 2- HD3000's, 450GB LVM partition


Last edited by benjohnson on Wed Jan 04, 2006 8:24 am, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 02, 2006 10:15 pm 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
Dale wrote:
Cesman, this would be a "good thing" to do by default to begin an effort to reduce the size needed for KnoppMyth.
Perhaps, but mostly likely post-R5.

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject: High CPU?
PostPosted: Tue Jan 03, 2006 1:02 am 
Offline
Joined: Sat Nov 13, 2004 2:24 pm
Posts: 59
Hi,

I just got done with the switchover, and it seems to out peform apache. However, I noticed that the cpu usauge spiked to 54% on refresh, causing my front-end to 'burp'.. Anybody else notice this? Other then that, the guide was perfect line-by line. Well done.

prosonik


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 4:46 pm 
Offline
Joined: Thu Dec 15, 2005 3:03 pm
Posts: 33
I'll look at the mailing lists and forums to see if this is a problem with my guide, or with lighttpd. And thnx for the comments...at least I'm good for something around here :P


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 10:54 pm 
Offline
Joined: Mon Mar 21, 2005 1:43 pm
Posts: 388
Location: Nanaimo BC
Followed the directions get know errors php -v looks like yours, lighttpd starts without errors but........The mythweb start page comes up but the listings page does not. I am running r5a26. Could some one point me in the right direction to figure this out.

Thanks

Craig


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 11:11 pm 
Offline
Joined: Mon Mar 21, 2005 1:43 pm
Posts: 388
Location: Nanaimo BC
Never mind for now I am tired and in the mythtv menu I pressed restore not restart. Now the frontend won't start so I am just going to do the upgrade to r5a31 then I will try this again. I have a feature request how about a box that pops up when you press restore that says "hey stupid are you sure you want to do this" lol


Craig


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 15, 2006 12:11 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
iscraigh wrote:
Never mind for now I am tired and in the mythtv menu I pressed restore not restart. Now the frontend won't start so I am just going to do the upgrade to r5a31 then I will try this again. I have a feature request how about a box that pops up when you press restore that says "hey stupid are you sure you want to do this" lol

There's actually a well documented tweak for that. Hang on and I'll see if I can find the thread... Ah, here it is: http://mysettopbox.tv/phpBB2/viewtopic.php?t=3959& you want the XML changes from khrusher's post about 8 or 9 down... I think someone else even had a script that asked "Are you sure?"


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 10:25 pm 
Offline
Joined: Mon Mar 21, 2005 1:43 pm
Posts: 388
Location: Nanaimo BC
Okay I loaded R5A30.1 and once getting it running I thought I would try this. Everthing went fine but I do get these two errors.

Warning at /usr/share/mythtv/mythweb/includes/init.php, line 151:
unlink(image_cache/2031_20060107223000_20060107230000.nuv.png): Operation not permitted

Warning at /usr/share/mythtv/mythweb/themes/Default/theme.php, line 16:
Cannot modify header information - headers already sent by (output started at /usr/share/mythtv/mythweb/includes/errors.php:68)

Any suggestions as to how I can track this down would be appreciated.


Mythweb does seem faster; I recommend this switch.


Craig


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 12:45 am 
Offline
Joined: Mon Mar 21, 2005 1:43 pm
Posts: 388
Location: Nanaimo BC
this was not a lighttpd error it happened when I switched back to apache. I solved it by deleting the images from the image_cache folder that were owned by root.

Problem has not returned and I am happy with the performance of lighttpd

Craig


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 19, 2006 11:55 am 
Offline
Joined: Tue Feb 14, 2006 2:12 pm
Posts: 6
Location: Canada
And to keep your http://mythtv/mythweb access secure as with your old .htaccess file and Apache setup, just follow these instructions: http://forum.lighttpd.net/topic/203#581

Edit /etc/lighttpd/lighttpd.conf and:

1- Uncomment the mod_auth line (remove the "#" sign)

Code:
#                                "mod_auth",


2- Add the following lines

Code:
# Allow HTACCESS for Mythtv
auth.backend           = "htpasswd"
auth.backend.htpasswd.userfile  = "/etc/apache/basicauth"
auth.require             = ( "/mythweb/" =>
                                    ( "method" => "basic",
                                      "realm" => "MythTV",
                                      "require" => "valid-user"
                                    )
                                  )


3- Save lighttpd.conf

Then restart the lighttpd server:

Code:
root@mythtv: /etc/init.d/lighttpd restart


Now load http://mythtv/mythweb/ in your favorite browser and you should get a login pop-up, the same as you used to get when running mythweb on Apache with the .htaccess file setup!

Mapper


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 10:35 pm 
Offline
Joined: Mon Feb 27, 2006 10:39 pm
Posts: 48
When I tried this I ened up with this when I accessed mythweb, any idea of why? my php -v came out exactly as the posted one. Using knoppmyth R5B7


Database Setup Error

The database environment variables are not correctly set in the
included .htaccess file. Please read through the comments included
in the file and set up the db_* environment variables correctly.

Some possible solutions are to make sure that mod_env is enabled
in httpd.conf, as well as having followed the instructions in the
README about the AllowOverride settings.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 
Go to page 1, 2  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu