Solved

Reading FTP from Apache Module

Posted on 2014-03-02
8
264 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 83

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 83

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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 26

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 26

Accepted Solution

by:
skullnobrains earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

914 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

13 Experts available now in Live!

Get 1:1 Help Now