LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 08-27-2015, 06:39 PM   #1
bluethundr
Member
 
Registered: Jun 2003
Location: Summit, NJ
Distribution: CentOS 5.4
Posts: 144

Rep: Reputation: 15
404 file not found errors with files that are on the FS


Hey guys,

Just have a question about apache. Hoping to get an opinion on this.

I've just setup a site under apache 2.4.12. This is on a RHEL 6.5 host.

And made sure that the document root setup in the vhost for the site I'm serving has permissions for the apache user. Yet some of the files are throwing a 404 error in a browser even tho they are clearly present and accounted for on the file system.

For example, I'm getting this error:
Code:
(index):1 GET http://stage.theshopatmycomany.com/mycomanyStore/images/altImg.png 404 (Not Found)

(index):1 GET http://stage.theshopatmycomany.com/mycomanyStore/images/Jimmy_485x1215_R2.jpg 404 (Not Found)

(index):1 GET http://stage.theshopatmycomany.com/mycomanyStore/images/Jimmy_792x802_R2.jpg 404 (Not Found)

(index):1 GET http://stage.theshopatmycomany.com/mycomanyStore/images/Jimmy_792x413_R2.jpg 404 (Not Found)
And yet as I mentioned all those files are definitely there on the file system:

Code:
[root@aozwsls00019la apache2]# ls -l /var/www/mycomanystore/images/altImg.png /var/www/mycomanystore/images/Jimmy_485x1215_R2.jpg /var/www/mycomanystore/images/Jimmy_792x802_R2.jpg /var/www/mycomanystore/images/Jimmy_792x413_R2.jpg

-rw-r--r--. 1 daemon daemon    128 Aug 27 12:22 /var/www/mycomanystore/images/altImg.png

-rw-r--r--. 1 daemon daemon 260983 Jul 16 14:03 /var/www/mycomanystore/images/Jimmy_485x1215_R2.jpg

-rw-r--r--. 1 daemon daemon 126628 Jul 16 14:00 /var/www/mycomanystore/images/Jimmy_792x413_R2.jpg

-rw-r--r--. 1 daemon daemon 222568 Jul 16 13:56 /var/www/mycomanystore/images/Jimmy_792x802_R2.jpg
And all those files have the correct ownership for apache:

Code:
[root@aozwsls00019la apache2]# egrep -i "user|group" conf/httpd.conf | egrep -i -v -e '#' -e log -e module

User daemon

Group daemon
All the files are owned by daemon:daemon!! So why on earth are these files giving a 404?

This is my virtual host for the site:



Code:
<VirtualHost *>

    ServerAdmin me@mycomany.com

    DocumentRoot /var/www/mycomanystore

    ServerName stage.theshopatmycomanystudios.com

 

    ErrorLog logs/store_error_log

    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    CustomLog logs/store_access_log common

    <Directory /var/www/mycomanystore>

      DirectoryIndex index.html

      AddHandler cgi-script .cgi

      Options -Indexes +FollowSymLinks +ExecCGI +Includes

      AllowOverride All

      Require all granted

    </Directory>

    ExpiresActive On

    ExpiresDefault "access plus 30 minute"

    RewriteEngine On

    RewriteCond %{REQUEST_METHOD} ^TRACE

    RewriteRule .* - [F]

</VirtualHost>
Thanks[/code]
 
Old 08-27-2015, 10:16 PM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
In the get request the "s" of "companystore" is capitalized:
Code:
(index):1 GET http://stage.theshopatmycomany.com/mycomanyStore/images/altImg.png 404 (Not Found)

Last edited by norobro; 08-27-2015 at 10:17 PM. Reason: typo
 
2 members found this post helpful.
Old 08-28-2015, 09:27 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Good catch, norobro!
 
Old 08-28-2015, 09:38 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
You can use mod_speling to have Apache look for files case-insensitive.

Code:
a2enmod speling
 
  


Reply

Tags
apache 2.4.2



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 says Error : 404 Requested URL Not Found when anaconda requests kickstart file g.navink Linux - Server 2 03-17-2015 11:23 PM
Error 404 File or directory not found totlin Linux - Server 3 11-14-2014 01:12 AM
404 Not Found The requested URL '/zm' was not found on this server. mickeyboa Ubuntu 8 07-26-2012 11:02 AM
Apache2 - file not found gets 500 Server Error instead of 404 Skaperen Linux - Software 5 01-30-2012 04:15 PM
locolhost errors to a gif file and not a Html 404 error almost000 Linux - Software 5 06-02-2007 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:46 AM.

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
Open Source Consulting | Domain Registration