LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 01-06-2008, 11:33 AM   #1
Sheridan
Member
 
Registered: Aug 2007
Location: Hungary
Distribution: Fedora, CentOS
Posts: 89

Rep: Reputation: 21
Apache won't server picture files if under aliased directory


Dear All,

I have a pressing problem.

Just migrated a bunch of webpages onto a new server (old server was not my doing).

There're lots of pages served as virtual hosts like this:

Code:
<VirtualHost *:80>
    UseCanonicalName    Off

    RewriteEngine on
    RewriteCond   %{REQUEST_FILENAME}       ^/(.*)cmd.exe(.*)       [OR]
    RewriteCond   %{REQUEST_FILENAME}       ^/(.*)root.exe(.*)
    RewriteRule   ^(.*)                     https://www.microsoft.com$1     [L,R]

    RewriteCond /export/www/root/%{HTTP_HOST}       !-d
    RewriteCond /export/www/root/%{HTTP_HOST}       !-f
    RewriteRule ^(.*)                     http://www.myhomepage.com/     [L,R]

    VirtualDocumentRoot /export/www/root/%0
    VirtualScriptAlias /export/www/root/%0/cgi-bin/
</VirtualHost>
Also, I have many aliases, like this:

Code:
Alias /ettcsa/ "/export/www/pildid/ettcsa/"
Alias /atma/ "/export/www/pildid/atma/"
Now, if I point my browser to a picture file inside one of the virtual hosts, it will work just fine.

However, if I try to open a picture (of any extension, gif, jpg etc) which is under one of the aliased routes, like:

http://mysite.com/ettcsa/pic.gif

Then Apache first sends back a HTTP 200 answer, tells the client the type and size of the file, then as transfer would begin, it just closes the connection.

This is easiest to test by using wget. If I go ahead and do wget http://mysite.com/ettcsa/pic.gif, then wget will try about 20 times to get the file, every time complaining about zero sized answer, then eventually it gives up.

However, if I put another kind of file, for example, a .php file into that dir and I try opening it, I get the page correctly. Same happens if the exension is unknown to Apache, like ".asfasfasf", or the file has no extension at all... I just don't understand...

What is my problem, what do you think?

L.

Last edited by Sheridan; 01-06-2008 at 02:18 PM.
 
Old 01-07-2008, 06:17 AM   #2
Sheridan
Member
 
Registered: Aug 2007
Location: Hungary
Distribution: Fedora, CentOS
Posts: 89

Original Poster
Rep: Reputation: 21
Do you think it could be a problem that I serve the files from an AFS mounted distributed FS?
 
Old 01-07-2008, 11:11 AM   #3
Sheridan
Member
 
Registered: Aug 2007
Location: Hungary
Distribution: Fedora, CentOS
Posts: 89

Original Poster
Rep: Reputation: 21
Lightbulb

Quote:
Originally Posted by Sheridan View Post
Do you think it could be a problem that I serve the files from an AFS mounted distributed FS?
It was EXACTLY the problem...

Turns out I had to turn off the following in httpd.conf, like if I were using an NFS mounted directory. AFS is like NFS in this regard.

Code:
EnableMMAP off
EnableSendfile off
Afther I did this, suddenly everything started working.

Maybe this will help another condemned soul.

Cheers!!!

Levente
 
  


Reply

Tags
afs, aliases, apache, nfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apache directory files Dannydy Linux - Software 0 10-10-2004 01:42 PM
apache server setup and how to place files in the var/www/html directory dramous Linux - Newbie 7 09-28-2004 05:18 AM
apache server setup and how to place files in the var/www/html directory dramous Linux - Software 3 09-25-2004 03:38 AM
apache server setup and how to place files in the var/www/html directory dramous Linux - General 2 09-25-2004 02:29 AM
[apache http server] directory hylke Linux - Software 8 08-02-2004 03:02 AM


All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration