Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: sandoz on June 12, 2007, 10:11:48 PM

Title: follow symlinks
Post by: sandoz on June 12, 2007, 10:11:48 PM
i needed an ibay with lots of space, so i added a 2nd HD
I moved the ibay according the howto, created a symbolic link in /home/e-smith/files/ibays/ibayname/ to point to the new dir, works fine, ftping goes to the new dir

Then i did:
db accounts setprop ibayname FollowSymLinks enabled
db accounts show ibayname

ibayname=ibay
    CgiBin=disabled
    FollowSymLinks=enabled
    Gid=5002
    Group=ibaygroup
    Name=bob
    PasswordSet=yes
    PublicAccess=global-pw
    Uid=5002
    UserAccess=wr-group-rd-group

then expand-template /etc/httpd/conf/httpd.conf
and
/etc/init.d/httpd graceful

but still i get a 403 Forbidden error
and in the error_log:

[Tue Jun 12 22:03:10 2007] [error] [client 84.30.x.216] Symbolic link not allowed: /home/e-smith/files/ibays/ibayname

what could have gone wrong?
Title: Re: follow symlinks
Post by: byte on June 12, 2007, 11:35:19 PM
Quote from: "sandoz"
Then i did:
db accounts setprop ibayname FollowSymLinks enabled


You may need a...

signal-event ibay-modify ibayname

Quote

/etc/init.d/httpd graceful


Also to restart services in SME look in the /etc/rc7.d/ in most cases from command you could use...

sv restart /service/httpd-*
Title: follow symlinks
Post by: sandoz on June 13, 2007, 08:41:53 AM
i also did the above:

Symbolic link not allowed: /

followsymlinks is enabled
[code]
<Directory /home/e-smith/files/ibays/ibayname/html>
    Options None
    Options +Indexes
    Options +FollowSymLinks
    Options +Includes
    AllowOverride None
    order deny,allow
    deny from all
    allow from all
    AuthName "bob"
    AuthType Basic
    AuthExternal pwauth
    require user bob
    Satisfy all
</Directory>
Title: follow symlinks
Post by: byte on June 13, 2007, 10:28:13 AM
In that case please report to the bug tracker as I've never used the FollowSymLinks code and can't test it myself at the moment, it may be a potential bug.

Thanks
Title: follow symlinks
Post by: mmccarn on June 13, 2007, 02:49:53 PM
Does 'FollowSymLinks' allow you to use a symlink for the target of your <Directory...> directive in httpd.conf, or does it allow you to have symlinks *in* the specified target?  I find the Apache docs mildly ambiguous on this:
Quote from: "[url
http://httpd.apache.org/docs/2.0/mod/core.html#options[/url]"]FollowSymLinks
    The server will follow symbolic links in this directory.

    Even though the server follows the symlink it does not change the pathname used to match against <Directory> sections.

    Note also, that this option gets ignored if set inside a <Location> section.

What happens if you create /home/e-smith/files/ibays/<ibayname>/html/external, then make that directory a symlink to your external hard drive?

Or, I have achieved what you're trying to do by deleting the entire contents of /home/e-smith/files/ibays/<ibayname>/html, then mounting my USB drive at that location by editing /etc/fstab and changing the mount point.
Title: follow symlinks
Post by: chaloner on June 14, 2007, 02:33:37 AM
I used;

db accounts setprop Primary FollowSymLinks enabled
db accounts setprop Primary AllowOverride All
signal-event ibay-modify Primary

Seems to work for me...


Chaloner Hale
Title: follow symlinks
Post by: mmccarn on June 14, 2007, 02:55:41 AM
Quote from: "chaloner"
Seems to work for me...


And you have the 'html' directory symlinked to a mounted usb filesystem?
Code: [Select]
# ls -l /home/e-smith/files/ibays/Primary
total 12
drwxr-s---  2 admin shared 4096 Apr  8 09:17 cgi-bin
drwxr-s---  2 admin shared 4096 Apr  8 09:17 files
lrwxrwxrwx  1 root  root     14 Jun 13 20:51 html -> /media/usbdisk


If so, what is the fstype on  your USB drive?  maybe there's a problem with fat32 drives, or maybe the drive sandoz is using is formatted ntfs?
Title: follow symlinks
Post by: sandoz on June 14, 2007, 09:02:33 AM
Quote from: "chaloner"
I used;

db accounts setprop Primary FollowSymLinks enabled
db accounts setprop Primary AllowOverride All
signal-event ibay-modify Primary


i did the above, with no succes
Drive is in EXT3

Code: [Select]

[root@csserver ~]# cd /home/e-smith/files/ibays/
[root@csserver ibays]# ls -l
total 12
lrwxrwxrwx  1 root root   29 Jun 12 20:50 ibayname -> /mnt/bigdisk/ibays/ibayname
drwxr-xr-x  6 root root 4096 Jun 13 09:36 Primary
drwxr-xr-x  7 root root 4096 Jun 13 09:36 sandoz
[root@csserver ibays]#
Title: follow symlinks
Post by: shawnbishop on June 14, 2007, 10:24:38 AM
I Have sort of the same problem...

I am pretty new to SME so trying to get my head around all the templates etc....

I have added a 2nd Hard Drive as per the How to, with 200GB of MP3 on it, now I have created a ibay called MP3 and used symlink to link the 2nd Hard Drive to this ibay...but I cant see the MP3 directory even though it is there..??

What should I do to enable my users on the network to see this directory, if I browse to the directory from a windows machine, I can see the original ibay called mp3, but not the directory in the ibay called MP3 which is on my 2nd Hard Drive

Cheers
Title: follow symlinks
Post by: mmccarn on June 14, 2007, 03:39:49 PM
I found that this worked (symlink created inside existing html folder):[list=1]
Title: follow symlinks
Post by: shawnbishop on June 15, 2007, 08:20:09 AM
Good Day

This is fantastic...but one small problem, this is if you want to see the files in a Web Browser...I am having the problem with SAMBA..

The directory shared over the network is not showing the directory that has been symlinked from the Big Disk to the ibay??
Title: follow symlinks
Post by: TrevorB on June 15, 2007, 08:34:08 AM
I have always found it easier to mount the new drive under the ibay that to try and circumvent the security put in place to stop externals being able to trawl your disk.
Code: [Select]
cd /home/e-smith/files/ibays/<ibay>/files
mkdir mydir
mount /dev/<my disk> /home/e-smith/files/ibays/<ibay>/files/mydir
(ps. you may need a -t <filesystem>)
You can mount it as /home/e-smith/files/ibays/<ibay>/files or even /home/e-smith/files/ibays/<ibay>.

You can make this survive a reboot by adding details into the /etc/fstab file.

Trevor B
Title: follow symlinks
Post by: shawnbishop on June 15, 2007, 09:39:28 AM
Hi

Yep I tried that, but then it asks for a username and password to access the directory, and none of the usernames and passwords on the machine can get me into the directory.
Title: follow symlinks
Post by: mmccarn on June 15, 2007, 01:45:42 PM
Quote from: "shawnbishop"
none of the usernames and passwords on the machine can get me into the directory
If I set the ibay to "user access via file sharing or ftp" ==> "Write=admin, Read=everyone", and "Public access via web or anonymous ftp" to "Local network (password required)", and use the 'Reset password' link to set a password for the ibay -- then I can login to the ibay with samba for read-only access.

If you set the "user access..." to "Write=everyone,Read=everyone", then you should get read-write access for all SME user or ibay accounts that have passwords set.

If you create a group, then set "Write=group,Read=group", then any users you add to that group should have read/write access to the ibay.  (Note: if any of your users are opening their own home folders using their own usernames/passwords, this is the method you will have to use.  Users are not able to connect to the SME server using two different usernames at the same time)

Also, samba access seems to be to the root of the ibay, one level above the /files and /html directories.