Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to view a webapp whose folder is in "/var/www/myapp", but Apache2 server sends me a HTTP/1.0 500 Internal Server Error.

I have an index, Htm, and a phpinfo() in "/var/www" and it works well.

share|improve this question
    
show logs from your error_log –  Mike May 17 '11 at 20:49
add comment

1 Answer

From what I gather from this question, you have some website where you can access:

http://yourserveraddress.com/index.htm

and that renders a page, but when you try to access:

http://yourserveraddress.com/myapp/

it sends a 500.

A 500 can mean a few things. One is that you might not have an index.htm or index.php file in your "myapp" folder, so Apache tries a request to render the folder itself and is disallowed from doing so (based on configuration or permission).

I'd make sure that there is an index file in myapp. If this is not the issue, then check the following command:

ls -lha /var/www

and

 ls -lha /var/www/myapp

This will list all the files and directories in your /var/www (and subsequently, /var/www/myapp) in a human readable format. For example, in /var/www you may have:

drwxr-xr-w  2 root root 4.0K Dec 12 02:24 .
drwxr-xr-w 14 root root 4.0K Nov 24 20:29 ..
-rw-r--r--  1 root root   76 Dec 12 02:25 index.html
drw-r-----  2 root root 4.0K Jan 14 01:14 myapp

(Note the filesizes/dates may be different, etc)

The 'root' in my example is the owner and the group. The stuff with the dashes, r,w,x are the permissions based on user/group/others. In my case, the web server can read everything but the myapp folder, because of permissions.

What may possibly be happening in your case, is that the user that is running your Apache may not have access to read the contents of myapp folder. One way to check this is to chown the files to the user that runs Apache (which I believe in Debian is defaulted to www-data) OR chmod the folder/files to the appropriate permission levels. A way to test to see if this is a permissions issue would be to set everything in your /var/www to chmod 777 (but note that you should not keep the permissions this way because of potential security concerns with other users of the server).

It is also important to check your error.log logs for the server running in /var/www.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.