Please note that when you run a web project from tomcat, e.g share. it first looks for web.xml in WEB INF folder. that file specifies the welcome page. So when you deploy the project or run ./alfresco.sh start command, the folder of your project name gets created in the webapps folder under tomcat. and the files inside the .war file gets extracted into that folder. That is the reason why you'll get error 404 if it didn't deploy because it look for files that doesn't exist in the <project-name> folder.
If you edit a file under webapps/share/ I would advice you to add it to the war file because if you clean the project, when you re-deploy it, you changes won't appear.
Thanks,
Croc