# Lighthttpd not working as default (configuration?)

**URL:** <https://www.ruby-forum.com/t/lighthttpd-not-working-as-default-configuration/56962>\
**Category:** Rails\
**Created:** [April 6, 2006, 2:21am UTC](https://www.ruby-forum.com/t/lighthttpd-not-working-as-default-configuration/56962 "2006-04-06T02:21:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oscar\_Picasso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/bbce88/32.png) [@Oscar\_Picasso](https://www.ruby-forum.com/u/Oscar_Picasso)\
**Post date:** [April 6, 2006, 2:21am UTC](https://www.ruby-forum.com/t/lighthttpd-not-working-as-default-configuration/56962/1 "2006-04-06T02:21:27Z")

</div>

Hi,

On the api doc it is written that if lighttpd is installed, rails will  
use it as its web server instead of WebBrick.

I have installed lighthttpd and verified it works (for example on the  
default port 80) but when lauching script/server, it still uses  
WebBrick.

I wondering if I need to edit /etc/lighttpd/lighthttpd.conf myself or  
configure something else.

Any idea?

Thanks

Oscar

---

<div class="post-metadata">

**Author:** ![Oscar\_Picasso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/bbce88/32.png) [@Oscar\_Picasso](https://www.ruby-forum.com/u/Oscar_Picasso)\
**Post date:** [April 6, 2006, 6:30am UTC](https://www.ruby-forum.com/t/lighthttpd-not-working-as-default-configuration/56962/2 "2006-04-06T06:30:39Z")

</div>

* * *

Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

---

<div class="post-metadata">

**Author:** ![Oscar\_Picasso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/bbce88/32.png) [@Oscar\_Picasso](https://www.ruby-forum.com/u/Oscar_Picasso)\
**Post date:** [April 6, 2006, 7:01am UTC](https://www.ruby-forum.com/t/lighthttpd-not-working-as-default-configuration/56962/3 "2006-04-06T07:01:21Z")

</div>

lighthttpd is on the path.

which lighttpd =\> ~/bin/lighttpd

It’s actually a symlink to /usr/sbin/lighttpd

I have installed it as root. I tried to launch it from the command line  
but i failed with  
(server.c.597) opening pid-file failed: /var/run/lighttpd.pid Permission  
denied

/var/run is not writable for non root users. I’ll try to investigate  
further.

Peter T Bosse II [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote: Make sure the path to lighttpd  
is in your path.Ã¯Â¿Â½ Try this:

which lighttpd

did it give you the path to lighttpd?Ã¯Â¿Â½ (On my system it’s installed in  
/usr/local/sbin/lighttpd)Ã¯Â¿Â½Ã¯Â¿Â½Where is lighttpd installed?Ã¯Â¿Â½ Is that  
directory in your path?Ã¯Â¿Â½ Try this:

echo $PATH

If the path to lighttpd isn’t listed you’ll need to add it.Ã¯Â¿Â½ Look in  
~/.bash\_profile or /etc/profile

- Peter

P.S. This all assumes you’re running Rails on Mac OS X or some other  
unix-y type system.

On Apr 5, 2006, at 5:20 PM, Oscar Picasso wrote:

Hi,

On the api doc it is written that if lighttpd is installed, rails will  
use it as its web server instead of WebBrick.

I have installed lighthttpd and verified it works (for example on the  
default port 80) but when lauching script/server, it still uses  
WebBrick.

I wondering if I need to edit /etc/lighttpd/lighthttpd.conf myself or  
configure something else.

Any idea?

Thanks

Oscar

* * *

Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great  
rates starting at  
1Ã¯Â¿Â½/min.\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

---

<div class="post-metadata">

**Author:** ![Oscar\_Picasso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/bbce88/32.png) [@Oscar\_Picasso](https://www.ruby-forum.com/u/Oscar_Picasso)\
**Post date:** [April 6, 2006, 3:36pm UTC](https://www.ruby-forum.com/t/lighthttpd-not-working-as-default-configuration/56962/4 "2006-04-06T15:36:17Z")

</div>

you can force lighttpd by giving it as an option as ‘script/server  
lighttpd’ if it can’t run it, most likely it’s not in your path.

script/server will look to see if it can run lighttpd (it tries to run  
‘lighttpd -version’). if it can, it will copy a default lighttpd.conf  
file  
from the RAILS\_ROOT/configs/ to yourapp/config/ unless it already  
exists.  
the server script then runs lighttpd with -f option for this new config  
file, which is tailor made (port/ip, log paths, etc) for running your  
app  
without requiring root access.

check out

RAILS\_ROOT/lib/commands/server.rb and  
RAILS\_ROOT/lib/commands/servers/lighttpd.rb  
RAILS\_ROOT/configs/lighttpd.conf

for more information on the process.
