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

share files by apache listing a directory

Hi everybody,
I have an Apache Web Server with a VirtualHost where i shared a directory using de "Option Indexes" directive into a Directory directive. It works, but when i try to download a binary file like an image or an zip file etc... don't recive anything, the file that i download has 0 bytes. Nevertheless when i try download a text/plain file, it is downloaded correctly.

There are not log errors

I attach the code of httpd.conf
<VirtualHost XXX.XXX.XXX.XXX:80>
ServerName ftp.itacyl.es:80
DocumentRoot "/var/ftp/"
CustomLog "/apps/apache/logs/access_ftp.log" common
 
<directory "/var/ftp">
        Options Indexes FollowSymLinks Multiviews
        IndexIgnore .*
        AllowOverride none
        Order allow,deny
        Allow from all
</directory>
</VirtualHost>

Open in new window

0
itacyl
Asked:
itacyl
  • 7
  • 2
  • 2
1 Solution
 
Maciej SsysadminCommented:
And you are completely sure, that those files are bigger than 0 bytes? :)
Can you download them from server itself (using wget for example)?
Can you provide output of "ls -l /var/ftp"?
0
 
itacylAuthor Commented:
Yes im sure, yu can enter and see it http://ftp.itacyl.es
this link don't download http://ftp.itacyl.es/cartografia/Ortofotos/untitled.bmp
but this other download correctlly http://ftp.itacyl.es/RINEX/horario_30s/2009/005/vala005a.09g

colud be mime types?
0
 
itacylAuthor Commented:
the version of this apache is 2.2.11
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
itacylAuthor Commented:
i have modify de configuration, but i have the same problem:

<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName ftp.itacyl.es:80
DocumentRoot "/var/ftp/"
ErrorLog "/apps/apache/logs/ftp_errorlog"
CustomLog "/apps/apache/logs/access_ftp.log" common
 
<directory "/var/ftp">
 
        Options Indexes Multiviews FollowSymLinks
        IndexOptions FancyIndexing IconsAreLinks
        IndexIgnore .*
        AllowOverride none
        Order allow,deny
        Allow from all
 
</directory>
 
<IfModule mod_limitipconn.c>
    <Location /var/ftp>
        MaxConnPerIP 3
        # In this case, all MIME types other than audio/mpeg and video*
        # are exempt from the limit check
        #OnlyIPLimit audio/mpeg video
    </Location>
</IfModule>
 
</VirtualHost>

Open in new window

0
 
Maciej SsysadminCommented:
I have to admit, that I have no idea what can be causing such behavior.
Can you provide output of: "ls -la /var/ftp/cartografia" command?
0
 
fosiul01Commented:
Hi yah just a quck thought

have you add the .zip extenstion in your apache file or in etc/mime.types ??

for etc/mime.types add the extenstion of the file

like this line

application/vnd.openxmlformats       docx pptx xlsx    [ add your extenstion]

try adding that extension in apache configuraiton file aswell

then restart the apache
see if it helps
0
 
itacylAuthor Commented:
Hi,
oklit, the result of ls -la /var/ftp/cartografia is:
"total 192
drwxrwxrwx 1 root root      0 2009-02-05 09:17 .
drwxr-xr-x 6 root root 143360 2009-02-23 02:53 ..
-rwxrwSrwx 1 root root    846 2007-10-04 13:31 banner
drwxrwxrwx 1 root root      0 2008-11-03 17:39 Catalogo
-rwxrwSrwx 1 root root    846 2007-10-04 13:31 Condiciones de uso.txt
-rwxrwSrwx 1 root root   8402 2008-12-15 11:37 Direcciones WMS de acceso a ortofotos de Castilla y Leon.txt
drwxrwxrwx 1 root root      0 2009-01-07 10:27 MDE
drwxrwxrwx 1 root root      0 2009-02-20 13:00 Ortofotos
-rwxrwSrwx 1 root root  27368 2008-12-15 11:39 Servicios WMS de Ortofotos de Castilla y Leon.xml
"
0
 
itacylAuthor Commented:
Hi,
fosiul01, the extensions zip, bmp, txt... alredy exist on mime.types file
0
 
itacylAuthor Commented:
Hi everybody,
i think that i know the problem, some of these folders are mounted with cifs (cartografia is one of these), and if i put a file in a folder that is local its works fine, so i think that the apache see the files in mounted folders like a pointer or link but dont serve the target.

Anybody have an idea to solve it?
0
 
itacylAuthor Commented:
im think that i solve it
with "EnableSendfile off" into httpd.conf file

thaks to everybody
0
 
fosiul01Commented:
HI good morning
sorry due to weakend didnot able to reply

its good to see your problem is solved and sorry i was not helpfull for this occassion...
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

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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