[us...@httpd] Apache as File Server

2009-11-07 Thread Nitin Gupta
Hi All

 

In my application, I have a scenario in which user can upload various files.
I am persisting these files on the File System itself. I need to make a http
interface on these saved files. Can I make use of Apache web server to serve
these files from the file system over http protocol? If yes, then please
suggest a optimal configuration to make Apache a typical file server.

 

Rgds

n



Re: [us...@httpd] Apache as File Server

2009-11-07 Thread André Warnier

Nitin Gupta wrote:

Hi All

 


In my application, I have a scenario in which user can upload various files.
I am persisting these files on the File System itself. I need to make a http
interface on these saved files. Can I make use of Apache web server to serve
these files from the file system over http protocol? If yes, then please
suggest a optimal configuration to make Apache a typical file server.


Suggestion for an optimal configuration :
- read the documentation at httpd.apache.org
- install Apache as per the documentation
- call up the starting page as per the documentation
- use the documentation to find out where this page is located on disk
- make some judicious logical deduction to figure out the answer to your 
question


-
The official User-To-User support forum of the Apache HTTP Server Project.
See http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] Apache2 content generators

2009-11-07 Thread antoine

Andre thank you very much for your response.

I think that putting mod_php (if it is possible) as an output filter is 
the only solution

to my project.

Regards

André Warnier wrote:

antoine wrote:

Eric Covener wrote:

On Thu, Nov 5, 2009 at 10:25 AM, antoine  wrote:
 

The first one(mine) adds some stuff to the html body and the
second one is the mod_php that takes the first's results and gives the
client the final page.




Is running PHP as a filter deprecated?  That'd be an option.

  

Sorry can you explain better. Thanks



Let me roll back a little bit, and then get back to Erik's question 
above.


Basically, there can only be one Apache "response generator" module.

There can be "input" filters before : they filter the HTTP request and 
can do something to the request, but not to the result yet, because it 
is not yet created.


Then there is one "response generator".  That is the one which 
(usually) gets the basic document from disk (or creates it from 
scratch), modifies it or not, and produces the HTTP response.


Then there can be more "output" filters, which act on the response 
already produced by the response generator above, and can modify it 
some more.


I am unfamiliar with mod_php, but I imagine that it usually functions 
itself like the "response genrator" above.  Thus, it picks up a 
document from disk, examines it to see if it contains any php to 
process, and if yes it processes this php and modifies the original 
document accordingly. Then it sends out the result as an HTTP response.


If that is how it works, then it is going to be difficult for you to 
insert something else before it.  Because then, your module would have 
to pick up the page from disk, do something to it, and then figure out 
a way to pass that modified document to mod_php to process.  But 
mod_php wants to pick up the original from disk also, so you have a 
problem.


On the other hand, if mod_php, like Erik mentions above, can also be 
configured to work as an output filter (instead of as the content 
generator), then this may be the solution.
Your module could then be "content generator" : pick up the original 
document from disk, produce a HTTP response, and that response would 
then be processed by mod_php acting as an output filter.


Got it ?
Now you have to check yourself if mod_php /can/ be configured to work 
as an output filter, like Erik seems to hint that it can, or could.




-
The official User-To-User support forum of the Apache HTTP Server 
Project.

See http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org





-
The official User-To-User support forum of the Apache HTTP Server Project.
See http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] Apache as File Server

2009-11-07 Thread John List

Nitin Gupta wrote:


Hi All

 

In my application, I have a scenario in which user can upload various 
files. I am persisting these files on the File System itself. I need 
to make a http interface on these saved files.




Can I make use of Apache web server to serve these files from the file 
system over http protocol?




Yes. That's the basic function of a web server!

If yes, then please suggest a optimal configuration to make Apache a 
typical file server.


 


Rgds

n



The default configuration should work just fine.

In order to display directory listings (indexes) of the files, you'll 
want to /avoid/ using the DirectoryIndex directive (which tells Apache 
to display an HTML page such as index.html etc. instead of an an index).


Check out:
http://httpd.apache.org/docs/2.0/mod/core.html#options
http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html
and http://httpd.apache.org/docs/2.0/mod/mod_dir.html

In its simplest configuration, Apache will display directory listings of 
the files at and below the web root and allow users to navigate the 
directories and download any file by right clicking on it.


Have fun!

John