Restart server

Discussion in 'Ruby/Rails' started by palb, Sep 17, 2007.

  1. palb

    palb New Member

    How do you restart the Rails app when you don't have direct access to the admin area?
  2. mistwang

    mistwang LiteSpeed Staff

    try "touch .ls_restart" under the virtual host root directory.
  3. palb

    palb New Member

    Great. I can't see that there is such a file, but it will of course be created when running touch. What if I upload the file via ftp? Would that give the same effect? It should be much the same, right?
  4. mistwang

    mistwang LiteSpeed Staff

    whenever the modified time of that file changes, the rails application will be restarted.
  5. palb

    palb New Member

    Thanks for fast replies. :)
  6. palb

    palb New Member

    Doesn't seems to work. What is supposed to happen? Will LS restart with that at once, or when you try to access the site from the web? Does it matter if the file is owned by someone else that server owner:group and what permission should it have?
  7. mistwang

    mistwang LiteSpeed Staff

  8. palb

    palb New Member

    Can't get this to work. I think it must be something about my path. How does this look:

    #RailsApp <name> <App Path> <Rails Evn> <Children Processes> <RunOnStart>
    RailsApp myappname "/public" "development" 4 1

    #RailsAppMap <name> <domain> <URI>
    RailsAppMap myappname "www.myappname.com" "/"

    It's relative to VH_root. That is located under my user directory in /myappname but the server is in /usr/local (Mac OS)
  9. mistwang

    mistwang LiteSpeed Staff

    Are you using a Enterprise edition?
  10. palb

    palb New Member

    No. So that's why. :) Ok. We're testing LS for our needs and we plan to switch to Enterprise edition if all goes well.
  11. palb

    palb New Member

    The need to restart the server after uploading new files to the server is not so good and the first negative thing I have to say about LS. I believe you need to address this. Or have I missed some settings in admin
  12. mistwang

    mistwang LiteSpeed Staff

    You need to restart the rails application with other rails hosting platform as well. Nothing special for LiteSpeed. With Enterprise edition, uploading a ".ls_restart" file together with the application, it will restarts.
  13. palb

    palb New Member

    Not with Mongrel if I remember it correctly. And Apache don't need it (though it doesn't run Rails). Or? Why would you need to restart the server when you've made a change in a file like css for example? It doesn't need to be restarted when you add it the first time.
  14. mistwang

    mistwang LiteSpeed Staff

    css file is cache by the browser not the server, the default configuration of LSWS tell browser to cache css files. You can turn it off.
  15. palb

    palb New Member

    Of course it's cached by the browser, if you don't set it to 0.

    When I look at the server files, .rhtml and css, they have the correct code. How come LSWS still serves me the old code? Hmm.
  16. mistwang

    mistwang LiteSpeed Staff

    No, LSWS does not even serve it, the css is from the browser cache, if you clear the cache and request the file again, you should see that the latest file.
  17. palb

    palb New Member

    No I don't. As a developer I don't have cache on. I've tested on several browsers on my Mac and PC. However, I now see a strange number in the href for the external css. That's LSWS. Could it be something about compression?
  18. mistwang

    mistwang LiteSpeed Staff

    The compressed version should be updated automatically as well. Please test it with command line tool like curl or Lynx.

    "lynx -mime_header http://your_url"
  19. palb

    palb New Member

    I don't have lynx, as it seems. I tried curl but not sure what to fetch. The header says:

    HTTP/1.1 200 OK
    Content-Type: text/html; charset=utf-8
    Set-Cookie: _session_id=115816877ed000ba7353d211be3346af; path=/
    Cache-Control: no-cache
    Date: Tue, 02 Oct 2007 20:55:16 GMT
    Server: LiteSpeed
    Connection: Keep-Alive
    Keep-Alive: timeout=5, max=100
  20. mistwang

    mistwang LiteSpeed Staff

    Just fetch the css file, see if it is the latest version.

Share This Page