can't configure rails path

karloff

Well-Known Member
#1
I seem to be having trouble setting my rails path


i enter /usr/local/bin/ruby and it says that i need to create manually.

i have check the permissions 0777, and the owner is nobody and group nobody (i also changed this to root and still it didn't work)

anyone help me out. what am i doing wrong?
 

mistwang

LiteSpeed Staff
#2
Are your lshttpd running as "nobody"? please check with "ps -ef | grep lshttpd".
Try command

sudo -u nobody /usr/local/bin/ruby -v

see if it works. If you got permission problem, you need to check the permission of directories along the path.
Is there any symbolic link along the path?
You can try manually change it by editing httpd_config.xml directly, see if it works.
 

karloff

Well-Known Member
#3
Are your lshttpd running as "nobody"? please check with "ps -ef | grep lshttpd".
Try command

sudo -u nobody /usr/local/bin/ruby -v

see if it works. If you got permission problem, you need to check the permission of directories along the path.
Is there any symbolic link along the path?
You can try manually change it by editing httpd_config.xml directly, see if it works.
can't find a permissions problem, i think anyway. should every dir along the path be set to nobody?

i tried to manually set the path to /usr/local/bin/ruby/

but get this error message now
missing <uri> in <context>
here is my rails.xml can you see any prob with it?
Code:
<?xml version="1.0" encoding="UTF-8"?>
<virtualHostTemplate>
  <vhRoot>$SERVER_ROOT/$VH_NAME/</vhRoot>
  <configFile>$SERVER_ROOT/conf/$VH_NAME.xml</configFile>
  <maxKeepAliveReq></maxKeepAliveReq>
  <smartKeepAlive></smartKeepAlive>
  <allowSymbolLink>1</allowSymbolLink>
  <enableScript>1</enableScript>
  <restrained>1</restrained>
  <setUIDMode>2</setUIDMode>
  <chrootMode>0</chrootMode>
  <virtualHostConfig>
    <docRoot>$VH_ROOT/public</docRoot>
    <enableGzip>1</enableGzip>
    <enableIpGeo></enableIpGeo>
    <adminEmails></adminEmails>
    <logging>
      <log>
        <useServer>1</useServer>
      </log>
      <accessLog>
        <useServer>0</useServer>
        <fileName>$SERVER_ROOT/logs/$VH_NAME.access.log</fileName>
        <logHeaders>3</logHeaders>
        <rollingSize>500M</rollingSize>
        <keepDays>30</keepDays>
        <compressArchive>0</compressArchive>
      </accessLog>
    </logging>
    <index>
      <useServer>0</useServer>
      <indexFiles>index.html, index.htm</indexFiles>
      <autoIndex>0</autoIndex>
      <autoIndexURI>/_autoindex/default.php</autoIndexURI>
    </index>
    <htAccess>
      <allowOverride>0</allowOverride>
      <accessFileName>.htaccess</accessFileName>
    </htAccess>
    <expires>
      <enableExpires>1</enableExpires>
    </expires>
    <security>
      <hotlinkCtrl>
        <enableHotlinkCtrl>0</enableHotlinkCtrl>
        <suffixes>gif, jpeg, jpg</suffixes>
        <allowDirectAccess>1</allowDirectAccess>
        <onlySelf>1</onlySelf>
      </hotlinkCtrl>
      <accessControl>
        <allow>*</allow>
      </accessControl>
    </security>
    <contextList>
      <context>
        <type>rails</type>
        <uri>/usr/local/bin/ruby/</uri>
        <location>$VH_ROOT/</location>
        <railsEnv>1</railsEnv>
        <maxConns>5</maxConns>
        <addDefaultCharset>off</addDefaultCharset>
        <rewrite>
          <enable>1</enable>
          <inherit></inherit>
          <base></base>
          <rules>RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]</rules>
        </rewrite>
      </context>
    </contextList>
    <rewrite>
      <enable>0</enable>
      <logLevel>0</logLevel>
    </rewrite>
    <frontPage>
      <enable>0</enable>
      <disableAdmin>0</disableAdmin>
    </frontPage>
    <awstats>
      <updateMode>0</updateMode>
      <workingDir>$VH_ROOT/awstats</workingDir>
      <awstatsURI>/awstats/</awstatsURI>
      <siteDomain>localhost</siteDomain>
      <siteAliases>127.0.0.1 localhost</siteAliases>
      <updateInterval>86400</updateInterval>
      <updateOffset>0</updateOffset>
      <securedConn>0</securedConn>
    </awstats>
  </virtualHostConfig>
</virtualHostTemplate>
 

karloff

Well-Known Member
#5
ok, so the uri should be set to $VH_ROOT/?


also i have my railsrunner.rb file which is like this
#!/usr/bin/ruby

Dir.chdir( ENV['RAILS_ROOT'] )

require 'config/environment'

require 'initializer'
require 'dispatcher'

#require 'breakpoint' if defined?(BREAKPOINT_SERVER_PORT)

#if RAILS_ENV=='production'
# require_dependency 'application'
# Dir.foreach( "app/models" ) {|f| silence_warnings{require_dependency f} if f =~ /\.rb$/}
# Dir.foreach( "app/controllers" ) {|f| silence_warnings{require_dependency f} if f =~ /\.rb$/}
#end

require 'lsapi'

#Close all DB connections established during initialization
ActiveRecord::Base.clear_active_connections! if defined?(ActiveRecord::Base)

while LSAPI.accept != nil
Dispatcher.dispatch
end
should the path at the top be /usr/local/bin/ruby??
 

mistwang

LiteSpeed Staff
#6
Yes, you can change that. But it should not matter as LSWS use the configuration under ruby tab.
You should not change the default Rails template which should work well.
 

karloff

Well-Known Member
#9
thats what i put and i get this error?
Code:
2008-01-21 16:38:29.986	ERROR	[config:vhost:paulcurley.co.uk:context:/] rewrite: Rewrite rule missing substitution string. while parsing: RewriteRule ^$

2008-01-21 16:38:29.989	ERROR	execle() failed with errno=13, when try to start Fast CGI application: /usr/local/bin/ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb!

2008-01-21 16:38:29.991	ERROR	execle() failed with errno=13, when try to start Fast CGI application: /usr/local/bin/ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb!
 

mistwang

LiteSpeed Staff
#10
Please try
Code:
sudo -u nobody /usr/local/bin/ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
Then keep trying until you figured out the permission problem. :)
Once it passes, your litespeed rails will work.

Command

Code:
sudo -u nobody strace /usr/local/bin/ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
should be able to help you figure it out.
 
Top