Solved

Reading FTP from Apache Module

Posted on 2014-03-02
8
262 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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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
 
LVL 16

Expert Comment

by:AlexPace
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:gazillabyte
Comment Utility
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 26

Expert Comment

by:skullnobrains
Comment Utility
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
Comment Utility
Thanks for your reply.

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

Accepted Solution

by:
skullnobrains earned 500 total points
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now