Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

500 instead of 404?

Status
Not open for further replies.

joethong

IS-IT--Management
Nov 9, 2001
10
MY
Hi guys,

Why am I getting a 500 Server Internal Error instead of 404 Not Found Page when I'm requesting an invalid file on Apache?

Any help would be much appreciated.

Joe
 
It could be a lot of different things but the one that pops to the top of my head is that if the file being requested by apache is in a directory that it doesn't have permission for, it will return a 500 error whether or not the file exists. You might try changing ownership or permissions. You should also read your error_log to see if it gives more details of the error.
 
Hi,



In linux you would do as root :



chown apache.apache abc.cgi (Change owner and group of abc.cgi to 'apache')



chown -R apache.apache /var/ (Change ownership recursively from named directory)



If you just do 'apache' instead of apache.apache' it only changes the owner - not the group. To change the group separately use 'chgrp' with similar syntax.



To change permissions (vs owner /group) you use 'chmod' . This can be using an octal mask of explicit permission flags. For example :



chmod 755 abc.cgi



that sets the mask as 7 (owner) 5 (group) 5 (others). The values correspond to rwx where r=4 w=2 x=1 so 7 = rwx and 5 = rx .



The other way is like this :



chmod o+x abc.cgi



(add 'x' (execution) permission for others)



See 'man chmod' 'man chown' 'man chgrp'


Also, if you execute the stat command against a file you will see the permissions shown both ways :

stat abc.cgi


Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top