SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Getting script/server to use lighttpd instead of WEBrick

    I'm setting up lighttpd and rails on Ubuntu linux. So far I have lighttpd set up just to serve static pages and I have a default installation of Rails 1.0. I know that Rails is supposed to be set up so that if lighttpd is installed on your machine it will use that instead of WEBrick; however, whenever I run script/server in a test Rails app it runs via WEBrick and not lighttpd. Is there anything special I'm supposed to do in order to get this working? The Ruby FastCGI bindings are installed as well (libfcgi-ruby1.8), but I've done nothing special to either the test Rails app I'm using or lighttpd.conf.

  2. #2
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Seen this? http://wiki.rubyonrails.com/rails/pa...cript%2Fserver

    Pertinent part:
    lighttpd has to be in your path for ./script/server to run it
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  3. #3
    SitePoint Evangelist lirux's Avatar
    Join Date
    Jan 2001
    Location
    Lisboa : Portugal
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure lighttpd is in your path?
    I think if it is, even if it's not properly configured it should try to start it (and at least show you an error)
    Duarte Carrilho da Graša
    RailsHelp.com: Searchable Rails reference
    CACA: Committee for the Annihilation of Complicated Acronyms

  4. #4
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have this problem too. If I start a console (windows xp) and type "lighttpd" it says: "LigHTTPD running...". But "ruby script/server lighttpd" says that lighttpd is not in my path.

  5. #5
    SitePoint Evangelist lirux's Avatar
    Join Date
    Jan 2001
    Location
    Lisboa : Portugal
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fenrir2
    I have this problem too. If I start a console (windows xp) and type "lighttpd" it says: "LigHTTPD running...". But "ruby script/server lighttpd" says that lighttpd is not in my path.
    You must add lighttpd to your path variable, else rails won't know where to find it. I haven't messed with windows in a couple of years... In case anyone on mac os is having this problem, to change the your path variable on mac os:
    You need to edit a file called .bash_profile (create it if it doesnt exist), in your home dir. To do this on the terminal:

    cd ~/
    pico .bash_profile


    This makes sure you're in your home dir and opens .bash_profile for editing, then add this:
    PATH="$PATH:/path/to/lighttpd/folder"
    Of course changing it to point to your lighttpd folder. For example my path is:
    PATH="/usr/local/bin:$PATH:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin"
    In my case lighttpd is in /opt/local/sbin


    On windows, it's something like Control Panel > System > Advanced > Environment Variables, or so I have been told
    Duarte Carrilho da Graša
    RailsHelp.com: Searchable Rails reference
    CACA: Committee for the Annihilation of Complicated Acronyms

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Okay, lighttpd is in my path. I originally got an error when trying to run
    Code:
    ruby script/server lighttpd
    the first time. The second time I tried it with sudo and it's now working. Thanks everyone

  7. #7
    SitePoint Evangelist lirux's Avatar
    Join Date
    Jan 2001
    Location
    Lisboa : Portugal
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I noticed that if you change the default port (i.e to pick 80 instead of 3000), you have to run it as superuser.
    And then once you start running it as superuser, i think it picks up the logfiles or something in a way that you cant run it as regular user anymore.
    i.e at least for me, last time i tried, once i run it as superuser, i can never run it as regular user again, but if i always run it at regular user it works fine... I can't really explain it but it just worked like that for me.
    Duarte Carrilho da Graša
    RailsHelp.com: Searchable Rails reference
    CACA: Committee for the Annihilation of Complicated Acronyms


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •