Koozali.org: home of the SME Server

Symlinks

Offline ltwally

  • ****
  • 108
  • +0/-0
Symlinks
« on: October 05, 2008, 06:48:38 AM »
I've been trying to get softlinks working with an ibay, and am having no luck getting it running.

So far, I've tried adding "Options +FollowSymLinks" to the /etc/httpd/conf/httpd.conf section for the appropriate ibay, followed by an "apachectl graceful".

I also tried "db accounts setprop testibay PHPBaseDir /home/e-smith/files/ibays/testibay", followed by a "signal-event ibay-modify testibay".

I've been poking around the manuals, and don't seem to find a way to do this.

The directory that I'm trying to link to is the ibay's "files" directory, which I would like to make available from the ibay's website.

Anyone know what I'm doing wrong?

Offline ltwally

  • ****
  • 108
  • +0/-0
Re: Symlinks
« Reply #1 on: October 05, 2008, 06:49:17 AM »
The exact error that I'm getting is:

"Forbidden

You don't have permission to access /files/ on this server."

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Symlinks
« Reply #2 on: October 05, 2008, 09:19:12 AM »
The exact error that I'm getting is:

"Forbidden

You don't have permission to access /files/ on this server."
What is the current setting in the database for your ibay:
Code: [Select]
db accounts show ibay
To where are you symlinking? Another ibay? Somewhere else on the file system?

What does the webserver log file say at the time you received the error, it most of the times holds a clue to where and why things do not work. Please post that as well.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline ltwally

  • ****
  • 108
  • +0/-0
Re: Symlinks
« Reply #3 on: October 05, 2008, 07:03:45 PM »
Quote
What is the current setting in the database for your ibay:
Code: [Select]
[root@server ~]# db accounts show test
test=ibay
    CgiBin=enabled
    Gid=5017
    Group=test_user
    Name=tests
    PHPBaseDir=/home/e-smith/files/ibays/test/
    PasswordSet=yes
    PublicAccess=global-pw-remote
    Uid=5017
    UserAccess=wr-admin-rd-group

Do I need to add "/home/e-smith/files/ibays/test/files/" to the PHPBaseDir ?? (I had thought that a parent directory would include the child-directory.)

Quote
To where are you symlinking? Another ibay? Somewhere else on the file system?
The directory that I'm trying to link to is the ibay's "files" directory, which I would like to make available from the ibay's website.

Quote
What does the webserver log file say at the time you received the error
[Sat Oct 04 21:41:33 2008] [error] [client xxx.xxx.xxx.xxx] Directory index forbidden by rule: /home/e-smith/files/ibays/test/files/



Thanks for the help.  I definitely appreciate it.
« Last Edit: October 05, 2008, 07:05:38 PM by ltwally »

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Symlinks
« Reply #4 on: October 05, 2008, 07:25:08 PM »
I suppose you have added httpd parameters through db keys and not directly in httpd.conf file, right?

I use the following commands for tunning my ibays as hosting for dinamic web content:

Code: [Select]
db accounts setprop test FollowSymLinks enabled
db accounts setprop test AllowOverride all
db accounts setprop test PHPBaseDir /home/e-smith/files/ibays/test:/tmp
signal-event ibay-modify test

For references look at http://wiki.contribs.org/DB_Variables_Configuration#Apache_server_ibay_specific_.28httpd-e-smith.29

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Symlinks
« Reply #5 on: October 05, 2008, 08:14:34 PM »
I suppose you have added httpd parameters through db keys and not directly in httpd.conf file, right?

I use the following commands for tunning my ibays as hosting for dinamic web content:

Code: [Select]
db accounts setprop test FollowSymLinks enabled
db accounts setprop test AllowOverride all
db accounts setprop test PHPBaseDir /home/e-smith/files/ibays/test:/tmp
signal-event ibay-modify test
But that is not what the OP asked and only works for PHP applications, OP does not state clearly he is using a PHP application.

The files folder he wants to share is normally not exposed by the webserver and protected to not be accessible from the webbrowser. It is this protection the OP is finding on his path.

ltwally why do you need to expose the files location, can you not put the contents in a (sub)folder of the html folder? This folder is exposed to the web  by default and your content of files should be available without further hassle.

If you really want to expose the files location to the web you will need to create a custom-template fragment. The permissions are defined in the following file: 90e-smithAccess40ibays, you need to create the same directory structure in the templates-custom tree and copy the file in there and make modifications to this copy. More information on the template system can be found in the SME Server Developers Guide which can be found in the wiki.

Be carefull, the file defines the properties for every files folder in all available ibays, so you might be better of relocating the files folder.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Symlinks
« Reply #6 on: October 06, 2008, 03:41:44 PM »
But that is not what the OP asked and only works for PHP applications, OP does not state clearly he is using a PHP application.
Now I remember who is.
Look at these threads Cactus:

http://forums.contribs.org/index.php?topic=42079.0
http://forums.contribs.org/index.php?topic=42081.0

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Symlinks
« Reply #7 on: October 06, 2008, 08:55:59 PM »
Now I remember who is.
Look at these threads Cactus:

http://forums.contribs.org/index.php?topic=42079.0
http://forums.contribs.org/index.php?topic=42081.0
Do not judge current behavior by his history, OP has not shown any behavior like this in this thread. He might be turning for the better.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Symlinks
« Reply #8 on: October 06, 2008, 09:33:53 PM »
Do not judge current behavior by his history, OP has not shown any behavior like this in this thread. He might be turning for the better.

??¿¿??
I talk about PHP. I refer you these posts because he always talk about PHP.

But that is not what the OP asked and only works for PHP applications, OP does not state clearly he is using a PHP application.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Symlinks
« Reply #9 on: October 06, 2008, 09:43:32 PM »
I talk about PHP. I refer you these posts because he always talk about PHP.
Sorry, I misunderstood you.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline ltwally

  • ****
  • 108
  • +0/-0
Re: Symlinks
« Reply #10 on: October 07, 2008, 05:12:58 PM »
Normando:

The instructions were a no-go. 

I still get:
Code: [Select]
Forbidden

You don't have permission to access /files/ on this server.

And this in the httpd error_log:
Code: [Select]
[Tue Oct 07 08:06:48 2008] [error] [client xxx.xxx.xxx.xxx] Directory index forbidden by rule: /home/e-smith/files/ibays/test/files/
« Last Edit: October 07, 2008, 05:19:00 PM by ltwally »

Offline ltwally

  • ****
  • 108
  • +0/-0
Re: Symlinks
« Reply #11 on: October 07, 2008, 05:16:57 PM »
ltwally why do you need to expose the files location, can you not put the contents in a (sub)folder of the html folder? This folder is exposed to the web  by default and your content of files should be available without further hassle.

Because e-smith only shows the /files/ directory to normal users, via SMB.  And we also want those files available over HTTP.

Offline ltwally

  • ****
  • 108
  • +0/-0
Re: Symlinks
« Reply #12 on: October 07, 2008, 05:18:32 PM »
If you really want to expose the files location to the web you will need to create a custom-template fragment. The permissions are defined in the following file: 90e-smithAccess40ibays, you need to create the same directory structure in the templates-custom tree and copy the file in there and make modifications to this copy. More information on the template system can be found in the SME Server Developers Guide which can be found in the wiki.


I will look into this and give it a try.  Thanks!

Offline ltwally

  • ****
  • 108
  • +0/-0
Re: Symlinks
« Reply #13 on: October 07, 2008, 05:42:46 PM »
Well, I looked at the templates.

E-smith is a really cool server... but the problem I always have is that doing things beyond what's included in the server-manager, and doing them the e-smith way, seems to require you to become an expert.  I just don't have that kind of time.

So, I modified httpd.conf, adding the following to <Directory /home/e-smith/files/ibays/test/files>
Code: [Select]
    Options None
    Options +Indexes
    Options +FollowSymLinks
    Options +Includes

Of course, the entire file will get nuked next time I do anything from the server-manager... but in the end, I'll spend less time re-creating my entries than I would reading up on templates and then doing the trial-and-error to getting it right.

Anyhoo.. thanks for trying.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Symlinks
« Reply #14 on: October 07, 2008, 06:07:40 PM »
Well, I looked at the templates.

ok

Quote
E-smith is a really cool server... but the problem I always have is that doing things beyond what's included in the server-manager, and doing them the e-smith way, seems to require you to become an expert.  I just don't have that kind of time.

well.. if you want to use SME, you should find the time to understand how it works.. templating system is easy as 1,2,3 if you read this:http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual#Configuration_file_templates

and the time needed is.. less than 15 minutes

Quote
So, I modified httpd.conf, adding the following to <Directory /home/e-smith/files/ibays/test/files>
Code: [Select]
    Options None
    Options +Indexes
    Options +FollowSymLinks
    Options +Includes

Of course, the entire file will get nuked next time I do anything from the server-manager... but in the end, I'll spend less time re-creating my entries than I would reading up on templates and then doing the trial-and-error to getting it right.

Anyhoo.. thanks for trying.

I don't subscribe this point of view (Cit. :-))

I repeat: read the dev manual (link above) and  retry.. You'll find that you can create your "own" server easily..

my 2c

Ciao
Stefano