So my ferret behaves nicely in dev mode, but I just deployed and now he is not happy! First thing I noticed was that in general my app would not start with a folder called "development" in my index folder, so I changed it to "production" and now my app is functioning. However, when I try to search I get errors, which you can see here: http://pastie.caboo.se/61767 Im no guru, but I would guess that my little stunt with renaming the directory wasn''t kosher enough for AAF What should I do?
Just found another quirk.. anytime i save or update something i get an error http://pastie.caboo.se/61773 I will assume that this all ties into my tomfoolery with directories
On Tue, May 15, 2007 at 06:01:07PM +0200, Steven Garcia wrote:> So my ferret behaves nicely in dev mode, but I just deployed and now > he is not happy! > > First thing I noticed was that in general my app would not start with > a folder called "development" in my index folder, so I changed it to > "production" and now my app is functioning.what was the error before you renamed that directory? In general, AAF does not rely on you to create the production directory, it can do this on its own given proper access rights - most of the time it''s just that the index directory cannot be accessed by Ferret because of missing write permissions to the index dir. Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa
Actually it was the same error ArgumentError ( isn''t a valid directory argument. You should use either a String or a Directory): my index folder is chmoded to 755... is that correct?
On Tue, May 15, 2007 at 07:31:04PM +0200, Steven Garcia wrote:> Actually it was the same error > > ArgumentError ( isn''t a valid directory argument. You should use > either a String or a Directory): > > my index folder is chmoded to 755... is that correct?that depends, with 755 only the owner of the directory may write to it. try chmod -R 777 index/ to check if the problem is with access rights. If it still doesn''t work then you can revert to the original access rights. Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa
That did the trick! I was worried about security risks, but if you say 777 is okay then I will run with it
On 5/15/07, Steven Garcia <steven at housecafemusic.com> wrote:> That did the trick! > > I was worried about security risks, but if you say 777 is okay then I > will run with itNo, no,no. 777 is not OK. That will open your site to Very Bad Things (tm). Jens was saying that the user running your app needs to have write access. You should figure out what user is running your app (mongrel?, lighty?, etc.) and make sure to give that user (only) write access. -- Sean Brown
On Tue, May 15, 2007 at 01:49:47PM -0400, Sean Brown wrote:> On 5/15/07, Steven Garcia <steven at housecafemusic.com> wrote: > > That did the trick! > > > > I was worried about security risks, but if you say 777 is okay then I > > will run with it > > No, no,no. 777 is not OK. That will open your site to Very Bad > Things (tm). Jens was saying that the user running your app needs to > have write access. You should figure out what user is running your > app (mongrel?, lighty?, etc.) and make sure to give that user (only) > write access.Full ACK, the 777 was only the short way of checking if it is a permissions problem in the first place. In addition to what Sean wrote above - if you''re running the DRb server it''s this process that needs write access, not your mongrels (as they will only talk to the DRb server). Won''t matter if you use the same user for mongrels and DRb, though. So once you know the user, give him write permissions and revert the permissions to something more restrictive again. Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa
Yikes, I totally didnt even consider DRB server..but i suppose its kind of a must for production huh? I really need to optimize my app... my VPS doesn''t have any RAM left over in the meantime, I will be studying this more. any links to DRB integration would be welcome cheers SG
Almost forgot to ask an obvious question.. how to i find out who the user is? I thought that chmod 775 would take care of this
On Tue, May 15, 2007 at 08:21:23PM +0200, Steven Garcia wrote:> Almost forgot to ask an obvious question.. how to i find out who the > user is? I thought that chmod 775 would take care of thischmod is used to set the permissions on a file (or directory or whatever :-). Basically each file has three sets of permissions associated with it: the first applies to the owning user of the file, the second to the group that owns the file, and the third to everybody else. chmod 755 means that the user owning the directory may read/write the directory (7), but everybody else may only read it (5 for group, 5 for others). To find out the owning user/group of a file use ls -l: drwxr-xr-x 4 jk users 4096 2007-01-10 11:09 index here the permissions are shown as ''rwx'' (7) or ''r-x'' (5), and that the index dir belongs to the user named ''jk'' and the group ''users''. So to the user ''jk'' the first set of permissions applies. To anybody else who is not ''jk'', but a member of the ''users'' group, the second set applies, and to everybody else the third one. To find out who''s running your mongrel, use the ps command: $ ps aux |grep mongrel the u option tells ps to show the user running each process in the first column of the output. Grep is only used to filter the process list, might be you have to grep for something else (i.e. ruby) if you don''t find your server by grepping for mongrel. Say the username your mongrel runs as is ''www'', then change the ownership of your index directory and all containing files like that: chown -R www index/ Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa
On Tue, May 15, 2007 at 08:19:59PM +0200, Steven Garcia wrote:> Yikes, I totally didnt even consider DRB server..but i suppose its > kind of a must for production huh? > > I really need to optimize my app... my VPS doesn''t have any RAM left > overDpeending on how large your index is and how many mongrel instances you''re running, DRb might actually save you some RAM.> in the meantime, I will be studying this more. any links to DRB > integration would be welcomehttp://projects.jkraemer.net/acts_as_ferret/wiki/DrbServer http://www.jkraemer.net/2007/3/24/acts_as_ferret-0-4-0-rie Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa