Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reading FTP from Apache Module

Posted on 2014-03-02
8
Medium Priority
?
299 Views
Last Modified: 2014-06-18
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
Comment
Question by:gazillabyte
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 39899515
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
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 39899518
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
 

Author Comment

by:gazillabyte
ID: 39900511
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 16

Expert Comment

by:AlexPace
ID: 39905553
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
 

Author Comment

by:gazillabyte
ID: 39906286
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
 
LVL 27

Expert Comment

by:skullnobrains
ID: 39932790
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
 

Author Comment

by:gazillabyte
ID: 39933122
Thanks for your reply.

I can't find any documentation that allows mod_proxy to serve a remote FTP server via HTTP.
0
 
LVL 27

Accepted Solution

by:
skullnobrains earned 1000 total points
ID: 39933843
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Loops Section Overview

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question