I'm trying to view a webapp whose folder is in "/var/www/myapp", but Apache2 server sends me
HTTP/1.0 500 Internal Server Error.
I have an index, Htm, and a phpinfo() in "/var/www" and it works well.
From what I gather from this question, you have some website where you can access:
and that renders a page, but when you try to access:
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:
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:
(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.