Koozali.org: home of the SME Server

Stop listing of files in ibay from Internet

Offline Thomas

  • ***
  • 65
  • +0/-0
Stop listing of files in ibay from Internet
« on: June 02, 2006, 01:45:34 AM »
I am running SME 6.0.1.  I have the contrib modIndexer installed.  I have one ibay that is accessible from the Internet without a password that I would like for the files in this ibay to not be listed when an Internet user goes to http://myserver/this_ibay.  Is this possible?  The reason for this is this ibay holds the files for my php web application (for the moment) and I don't want a user to see these or open them.

Thanks,
Thomas

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Stop listing of files in ibay from Internet
« Reply #1 on: June 02, 2006, 03:56:46 PM »
Quote from: "Thomas"
I am running SME 6.0.1.  I have the contrib modIndexer installed.  I have one ibay that is accessible from the Internet without a password that I would like for the files in this ibay to not be listed when an Internet user goes to http://myserver/this_ibay.  Is this possible?  The reason for this is this ibay holds the files for my php web application (for the moment) and I don't want a user to see these or open them.

Thanks,
Thomas
Issue the following commands on the command prompt:
Code: [Select]
db accounts setprop ibayname Indexes disabled
expand-template /ect/httpd/conf/httpd.conf

Now the configuration is modified for this ibay but we need to load the configuration again for the changes to apply, you can simply reboot, or just restart the httpd service, but I don't remember the exact command for this on SME 6. On SME 7 it should go like this:
Code: [Select]
/etc/rc7.d/S86httpd-e-smith sigusr1
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 Thomas

  • ***
  • 65
  • +0/-0
Stop listing of files in ibay from Internet
« Reply #2 on: June 11, 2006, 04:42:38 PM »
Hey cactus, when I type "db accounts setprop ibayname Indexes disabled"at the command prompt and hit enter I get "bash: db: command not found"

What do I do now?

Thanks,
Thomas

Offline Thomas

  • ***
  • 65
  • +0/-0
Stop listing of files in ibay from Internet
« Reply #3 on: June 11, 2006, 07:43:07 PM »
Well after some more searching I found the commands are:

/sbin/e-smith/db accounts setprop ibayname Indexes disabled
/sbin/e-smith/expand-template /ect/httpd/conf/httpd.conf

I then rebooted, BUT, going to http://www.mydomain/ibayname still lists the files there.  How can I stop theses files from being listed?  Remember I have modIndexer running.  

Thanks,
Thomas

Offline Thomas

  • ***
  • 65
  • +0/-0
Stop listing of files in ibay from Internet
« Reply #4 on: June 13, 2006, 02:26:32 AM »
Anyone?

Offline mmccarn

  • *
  • 2,653
  • +10/-0
Stop listing of files in ibay from Internet
« Reply #5 on: June 13, 2006, 04:13:06 AM »
Here are a couple more ways to affect "Indexes" that might work for you:

1. Create an "index.html" file in your i-bay that displays a blank page, an error message, or redirects the visitor to another site - then the autoindex function will never be invoked.

or

2. Create a custom template fragment that turns off indexing for the i-bay in question (note: the name I've given here is arbitrary, but must begin with a number high enough to cause 'expand-template' to add your content at the end of httpd.conf, so that your "Options -Indexes" will not be overruled by another setting later in the file)

Code: [Select]
# pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/96TurnOffIbayIndexing

then add this content:

Code: [Select]
<Directory /home/e-smith/files/ibays/[ibayname]/html/ >
Options -Indexes
</Directory>

(be sure to replace [ibayname] with the name of your i-bay).

Then:

Code: [Select]
sbin/e-smith/expand-template /ect/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith restart

Offline Thomas

  • ***
  • 65
  • +0/-0
Stop listing of files in ibay from Internet
« Reply #6 on: June 13, 2006, 05:38:30 AM »
I just needed a quick fix for now and the index.html works perfectly!  I'll try the other way later.

THANKS!

PS - still wondering why the stuff cactus suggested didn't work....

Offline mmccarn

  • *
  • 2,653
  • +10/-0
Stop listing of files in ibay from Internet
« Reply #7 on: June 13, 2006, 05:55:39 AM »
When I do
Code: [Select]
/sbin/e-smith/db accounts show  I only get the following items for each i-bay on 6.01 (with the "smeplus.sh" upgrades):
Quote
xxx=ibay
    CgiBin=enabled
    Gid=5001
    Group=shared
    Name=ibay name
    PasswordSet=no
    PublicAccess=global
    Uid=xxxx
    UserAccess=wr-group-rd-everyone

Since there's nothing in here about "Indexes" I wonder if the "Indexes" support was put in for 6.5 or 7, and just doesn't work in 6.0.  

This is just a guess, though!