The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Auto copy for files from folder to folder upon instant writing Bashar UNIX for Advanced & Expert Users 2 08-21-2008 11:44 AM
How to display contents of folder when 'cd' is used mumashankar UNIX for Dummies Questions & Answers 3 03-06-2008 04:42 PM
Parse the .txt file for folder name and FTP to the corrsponding folder. MeganP Shell Programming and Scripting 3 07-03-2007 10:54 AM
Take a folder name and find it in another folder (Complicated) hkhan12 Shell Programming and Scripting 5 09-06-2006 09:25 AM
copy folder contents robsk8_99 UNIX for Dummies Questions & Answers 1 02-22-2005 03:54 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-10-2003
Registered User
 

Join Date: Jun 2003
Location: Hertfordshire, UK
Posts: 4
Folder Contents

Hi,

I'm trying to allow people to access the contents of a folder on a web site, I am automatically placing files in this folder for people to download. I'm using Apache on Mac OS X, if that makes a difference.

Can anyone help with this? I've found no documentation on this so far...

Thanks!
Forum Sponsor
  #2  
Old 07-10-2003
oombera's Avatar
Registered User
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
You just want to be able to let people view the files like they would in windows explorer?

You may have to adjust some security settings in apache, but try creating a folder in your website but don't place an html file in there that would load by default, such as index.html (or index.htm, default.html, etc - there should be a place in apache that lists all such files that apache will search for to load as a default page). I think if apache can't find any files in that list to load as a default page, then it will create a listing of all the files in the directory.
  #3  
Old 07-10-2003
Registered User
 

Join Date: Jun 2003
Location: Hertfordshire, UK
Posts: 4
Hi, thanks for the response!

Yes, I do want a file listing as you've stated. All I want to do is put TAB separated files in this folder and allow users to download by selecting them.I've already tried having a folder without HTML files, but simply get this error:


Forbidden
You don't have permission to access /reports/test/ on this server.

So, I presume I need to allow users to 'view folder contents' somehow...
  #4  
Old 07-10-2003
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,477
I don't know what you mean by TAB separated files. However, if you are satisfied with automatic directory listing that you see on typical Apache servers, then you have to check several things:

1) The directory config allows file listing. In httpd.conf make sure the concerned directory has "Indexes" in "Options". You may need to explicitly add a section to the config file to override the default, which is a very restrictive one.

e.g. try

<Directory "/reports/test">
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

2) The directory has a chmod of 755 (don't know if MacOS needs this?)
  #5  
Old 07-11-2003
Registered User
 

Join Date: Jun 2003
Location: Hertfordshire, UK
Posts: 4
Hi, and thanks!

This worked perfectly. It's made me feel a little adventurous - is it possible to change the default file listing to reverse alphabetical order? I want to put some files on which I'll name by date, (yyyymmdd_filename.xxx) but want it to pick up the most recent first. I know users can just click the headers at the top to sort, I was just wondering if it's possible.

The files I'm putting on were tab separated exports from a database, but it just 'shows' them in the browser when saved as .tab - so I'm saving them as .xls (excel) so they are downloaded when clicked.

My understanding is that Mac OSX is effectively like a pretty GUI for UNIX, but commands like chmod are definitely relevant, there's only so much you can do without 'getting dirty' with the terminal. Also, I've found the front-end to be a little confusing.

Thanks again.
  #6  
Old 07-11-2003
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,477
About the directory listing, Apache has very little configuration to influence how the listing looks like. Fortunately, the IndexOrderDefault directive seems to do what you want.

For more configuration options, see also the IndexOptions directive. If you are not using 2.x, check the documentation of your version to see if these directives are applicable for your version.

I don't know much about MacOS (especially OS X). From your description and some little pre-OS X adventure I believe OS X is indeed a pretty form of Unix. But I would like to know whether MacOS X only runs on Mac? I didn't find the answer when it was released (last year?) and if not, I may be interested to have a look at it.
  #7  
Old 07-11-2003
Registered User
 

Join Date: Jun 2003
Location: Hertfordshire, UK
Posts: 4
It is Apache 2, that IndexOrderDefault looks good to me! Thanks for that.

I'm almost certain OS X will only run on a Mac. I've asked people about this and it seems to be the general consensus. I've found OS X to be more robust than previous Mac OS, and as it now embraces UNIX, it means I get some experience there.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0