• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

Reading FTP from Apache Module

I have to write a web service which downloads data from an FTP site.

My plan is to implement the service as an Apache module which will run on both Apache for Linux and Apache for Win32.

Before I go looking for a portable FTP library I was curious if anyone knew if there was a way to do this with either the apr library of another Apache module providing the FTP client access (perhaps some sort of proxy module).

mod_ftp provides FTP server functions so I am kind of looking for the opposite (FTP over HTTP rather than HTTP over FTP).
0
gazillabyte
Asked:
gazillabyte
  • 3
  • 2
  • 2
  • +1
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
I'm confused about what is where.  You have to write a web service which runs on Apache.  Where is the FTP site?  What programming language are you intending to use?  PHP and cURL can both do that without writing a separate FTP module.
0
 
Dave BaldwinFixer of ProblemsCommented:
Also, it is FTP or HTTP but not one over the other.  All the browsers I know of have a basic FTP client built into them in addition to the obvious HTTP(s).
0
 
gazillabyteAuthor Commented:
I'm confused about what is where.  You have to write a web service which runs on Apache.  Where is the FTP site?  What programming language are you intending to use?  PHP and cURL can both do that without writing a separate FTP module.

The FTP site is not on the machine where the Apache module is running.

I am writing the module in C.

I would rather not use libcurl.

As I asked originally, does anyone know if this can be done with the apr library, or by using the services of another Apache module?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
AlexPaceCommented:
Why don't you just use a scriptable FTP client like WinSCP and if WinSCP doesn't have enough scripting power you could step up to Robo-FTP but, as far as I know that only runs on Windows.

Anyway, FWIW, just make sure you are not stuck in a situation where the only tool you have is a hammer so ever solution looks like a nail.
0
 
gazillabyteAuthor Commented:
Alex

Seriously, if you don't know the answer, there's no need to change the question.

I'm looking for something that runs on Windows, Linux and z/OS. Does WinSCP run on z/OS?
0
 
skullnobrainsCommented:
mod_ftp provides FTP server functions so I am kind of looking for the opposite (FTP over HTTP rather than HTTP over FTP).

not sure this fits your need but can you configure your clients to use apache as a proxy ? if so apache antively supports FTP over HTTP (using mod_proxy, of course)

----

you can always also mount an ftp drive and serve it using apache. this is trivial to do both in windows and linux and i'd assume on z/OS as well
0
 
gazillabyteAuthor Commented:
Thanks for your reply.

I can't find any documentation that allows mod_proxy to serve a remote FTP server via HTTP.
0
 
skullnobrainsCommented:
as far as i remember it is enabled by default and you'd need to add restrictions if you want to disable it. just make sure mod_proxy and mod_proxy_ftp are present and refer to the documentation of mod_proxy to enable the proxy and disable HTTP and HTTPS support if you don't want them

note that the ftp proxy only handles download (which i assume is ok given the question)

- configure the client to use an http proxy for all protocols including ftp or for ftp only
- the client will send something like "GET ftp://...\n\n"
- and the proxy will answer with the contents

---

if you don't want to configure stuff in the client, you can alternatively use something like this

proxypass / ftp://FTPserver/pathx/

which will let you download files from an ftp server using a regular http URL

if the client connects to http://yourserver/path/file.txt
he will download ftp://FTPserver/pathx/path/file.txt
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now