954,074 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

apache as an ftp server

Hello forum:

I am trying to make apache an ftp server. I think this is possible because apache has mod_ftp.
Below is a snippet of my httpd.conf file that has the configuration for a virtual host to serve as an ftp server:

.
.
.
LoadModule ftpd_module modules/mod_ftpd.so
LoadModule ftpd_default_module modules/mod_ftpd_default.so
.
.

NameVirtualHost 192.168.x.x

Listen 21

#FTP On
FtpProtocol On
FtpAllowActive Off
ServerName ftp.myboxdomain.com or IP
DocumentRoot /var/www/html/ftpdocs

# AuthName "FTP Server"
# AuthType Basic
# AuthUserFile /etc/httpd/conf/passwd/.htpasswd
# Require valid-user
Order allow,deny
# Allow from all
Allow from 192.168.x.x

Now the following is my host file on my linux box:
# Do not remove the following line, or various programs
# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost
192.168.x.x www.myhostname.com myhostname
192.168.x.x ftp.192.168.x.x or IPaddress

If there is a solution someone can help me find, please let me know. I have been working on this for three days, and I just do not get it right. I also wonder if I have to use an ftp server like proFTPD along with apache.

I am running Apache/2.0.59 (CentOS) Server.
Thanks.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

the best way to go is to set up a normal ftp server besides Apache. these things are to be used as intended.

here is the description: http://incubator.apache.org/ftpserver/

since this is a java written thing, I wouldn't get near it for performance.

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

Hello Dima Yasny:

I went to that site before, but I did not
find it useful. When you say to set up a
normal ftp server besides Apache, do
you mean I need to have an ftp server,
like proFTP running, together with the apache
ftp virtual directory?

There has to be a way to achieve this.
I just want users to be able to upload
and download files via a browser. Just
like I would download winzip for example.

Thanks.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

the ftp will have nothing to do with the apache VD. it's just a service. if you want it's name to be known as ftp.domain.com instead of www.domain.com you just need to add the ftp.domain.com A record to your DNS

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

OK. I will keep working on this until I get it sometime. Have you ever got this working
under apache? I mean, making apache an
ftp server as well as a web server?

Thanks.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

I have set up many linux servers with apache as http server and vsftpd/proftpd/wu-ftpd as ftp servers

apache is NOT and ftp server though.

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

http://www.outoforder.cc/projects/apache/mod_ftpd/docs/

this is the documentation you might need. though as I said - there is no need to reinvent the wheel, when there are perfectly good ftp daemons out there

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

Ok. That is a good site. If you look at my first post, it is really about the same
thing I have configured in the apache virtual server.

Now, I think this is the way I should do things.

1) Configure an ftp virtual server like the one I have.
2) Have an ftp daemon running like vsftpd or proftpd.
3) Create accounts for vsftpd or proftd or whatever daemon I am using.

Can you suggest me about a server name for the ftp virtual host.
I am not doing DNS for this one, I am just editing my /etc/hosts file
accordingly like I posted.

Thanks a lot for your insights and your time on this.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

can you, in detail, describe what exactly you want the server to do?

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

I want to get apache running as an ftp server. I am not sure, however, if I need an ftp daemon like proftpd running along with the apache ftp virtual directory. I want users to upload and download files via a browser. Let us say I create a directory /home/ftpdocs. Then my document root would be /home/ftpdocs.

I want apache to display, via a browser, whatever files users upload to that particular directory on the server as well as be able to download those files.

Like I said, I do not know if I need a separate ftp daemon running or just apache with the ftp virtual directory.

Thanks a lot.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

apache can display and browse through files in a directory. I think that is enabled by default. so if you point it to the ftp root - it will display everything and let you click and download the files there. that is the default setting really.

any ftp daemon can be pointed to the same directory for ftp access, and clients will be able to put/get files there through ftp, and then browse the directory over http (which is provided by apache)

the only question is what authentication are you looking at?

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

I am looking for basic authentication.
Users would be allow to have read-only acces while
files are on the server. However, they would be able
to modify those files once they have downloaded them.

I really apreciate your help. I do not have much experience
working with apache ( 5 months only ).

I have a question. How would you make the ftp daemon
point to the directory where the files are?

I think I only seen that feaute in the proftpd.conf file only.
Do all others like vsftpd and wu-ftpd have that option?

Thanks.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

of course, all of them can be configured to point to an arbitrary directory in the FS and even be chrooted.
and if the read only browsing with a web browser will not need authentication you're basically ok to go with the default settings of apache

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

Ok Dima. This is the deal for now. I will keep working according to your instructions. I am heading home now because I have been working on this since Monday, and I am not
myself anymore. I am kind of anxious because of this.

I would like to know if we can continue working on this together either tomorrow or whenever you have some time. This is really a work assignment. However, I also want to get this through even if the company changes plans since this is teaching me a lot about both apache and ftp. I have never worked with ftp before.

I hope we can come back to this again.
Thanks Dima.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

will, since it is past midnight now and I have to work tomorrow, I will be able to help you tomorrow, if I have the time

anyhow, a good idea would be to get onto howtoforge.com - there are lots of ftp step by step guides there

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

Hello Everyone:

I am still working on doing ftp uploads/downloads via a browser. As we all can see, Dima has been guiding me through parts of the process. If anyone else would love to join us, please come aboard.

Thanks.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 
DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

Thanks Dima. I am going to check that out.
I will post whatever solution we can get out of this.

Thanks.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

Hello Anyone:

I have installed pure-ftpd on my centos linux
box. However, I am looking for the configuration
file to configure it. I think it does not have one.
Does it? Please let me know.

Also, if it does not have a configuration file, then
how I can configure it?

Thanks.
--Willie

williebens
Light Poster
42 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 
DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
 
View similar articles that have also been tagged: