Monkey problem.


Forum: Apps
Topic: Monkey problem.
started by: Zucca

Posted by Zucca on Oct. 02 2006,19:38
Ok. It seems that whenever I create a symlink to a directory it works just fine. I can access into it with my web browser. But when I create a symlink to a file, monkey gives me 'Forbidden' status.
I tested that with same directory:
1. I created a directory.
2. Made a symlink of a <file> there.
Result == Forbidden
1. Ok I then made symlink of the directory that contained <file>.
Result == Works fine. I could download that file.

Ok. Is there anything I should know about symlinks?
I create symlinks always like this:
Code Sample
ln -s <file/directory to link> <link (path) name>
.

Posted by mikshaw on Oct. 02 2006,20:12
It could be the permissions set on the linked file.  If it's readable only by the file's owner and group you will get a 403. Monkey runs as user "nobody", so a file with no read permission for "other" will be denied. For example, a file chmoded 644 will be readable, but 640 or 600 will not.
Posted by Zucca on Oct. 02 2006,21:10
I've checked that. But no.
Files are on FAT partition. ;)

Maybe I can find a solution by creating a user that has limeted access. Then try to access with that account to those files.

If that goes just fine (meaning it's problem with monkey) then I think installing Cherokee and forgot Monkey.

Posted by mikshaw on Oct. 02 2006,22:11
I have no idea how linux handles file permissions on fat partitions.  Maybe it has to do with the way the drive is mounted, but i couldn't say.

I don't have any other ideas right now.

Posted by clacker on Oct. 03 2006,17:05
You can change the owner and group of the files on a vfat partition using the uid=dsl and gid=staff options, either from mount or by adding them into the /etc/fstab entry for the device.

mount /dev/hda1 /mnt/test -t vfat -o uid=dsl,gid=staff

I was able to get monkey to serve up a web page from a FAT drive by first mounting the drive as shown above (so that the files were all dsl/staff), creating a link in my home directory, and then copying that link into /opt/monkey/htdocs:

Code Sample
mount /dev/hda1 /mnt/test -t vfat -o uid=dsl,gid=staff
cd /home/dsl
ln -s /mnt/test/myfile.html newfile.html
sudo cp newfile.html /opt/monkey/htdocs

Posted by Zucca on Oct. 05 2006,21:18
But that's not my problem. My problem is that symlinks to files won't work. ;(

Anyways I did this:
Code Sample
sudo mount -o remount,owner=dsl,mode=0755,uid=dsl,gid=staff /mnt/hda10

Same result as before. :(

Posted by clacker on Oct. 06 2006,01:45
I was able to get a symlink to a file to work, but only when I created the link in my home directory first and then copied the link into the /opt/monkey/htdocs directory with the cp command.

Try creating the symlink in your /home/dsl directory and then copying it into the /opt/monkey/htdocs directory.  It worked for me when I did that but not when I created the link in the /opt/monkey/htdocs directory directly.  I don't know why.

Posted by Zucca on Oct. 06 2006,10:17
I have already set my webserver root to /home/dsl/www/... But I'll try that.
Posted by Zucca on Oct. 06 2006,10:37
Won't work. It still gives me forbidden status.  :angry:
Posted by clacker on Oct. 06 2006,18:59
Zucca, I missed before that the error you're seeing is "Forbidden" and not "Not found."  I think I understand now.  You're trying to run a script, right?  And the script gets loaded from the FAT partition?  If that's the case, then it's not the owner that's the problem but that the executable bit isn't set.  I don't think your mode=0755 option is doing the trick.  Try using the umask=000 option in mount along with the other switches you used and that may help:

mount /dev/hda10 /mnt/test -o uid=dsl,gid=staff,exec,umask=000

The numbers in umask are the opposite of what chmod command uses, the bits that are on remove priveledges instead of adding them.  So if you wanted the equivelant to a 755 from chmod, use 022 in umask:

sudo mount -o uid=dsl,gid=staff,exec,umask=022 /dev/hda10 /mnt/hda10

I don't trust the "remount" switch, I found I had to use umount and the mount again to get the changes to take effect.  I also dont think the mode=0755 did what you wanted it to.

Good luck.

Posted by Zucca on Oct. 08 2006,16:21
It may be because my HD is a bit corrupted... But anyways here's my mount -l output
Quote
/dev/root on / type ext2 (rw)
/dev/shm on /cdrom type tmpfs (ro)
/dev/cloop on /KNOPPIX type iso9660 (ro)
/ramdisk on /ramdisk type tmpfs (rw,size=512M)
/proc/bus/usb on /proc/bus/usb type usbdevfs (rw,devmode=0666)
tmpfs on /ramdisk/tmp type tmpfs (rw,size=256M)
tmpfs on /ramdisk/home type tmpfs (rw,size=10M)
/dev/hda10 on /mnt/hda10 type vfat (rw,nosuid,nodev,umask=000,uid=1001,gid=50,owner=dsl,devmode=755,mode=0755,uid=1001,gid=50,umask=022)
/dev/hda6 on /mnt/hda6 type vfat (rw,nosuid,nodev,umask=000,uid=1001,gid=50,owner=dsl,devmode=750,mode=0750,uid=1001,gid=50)
/dev/sda1 on /mnt/sda1 type vfat (rw,nosuid,nodev,umask=000,uid=1001,gid=50,owner=dsl,devmode=750,mode=0750,uid=1001,gid=50)
/dev/sdb2 on /mnt/sdb2 type ext3 (rw,nosuid,nodev) [casper-rw]

Won't work with those options. (hda10)

Posted by Zucca on Oct. 08 2006,16:29
Quote (clacker @ Oct. 06 2006,16:59)
I think I understand now.  You're trying to run a script, right?

Nope. I'd never place scripts/executables on fat partition. I just want serve some files temporarily. And only (currently) working way is to copy or move those files.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.