Well there is a problem in your script. When you write script better use aboslute path instead of tilde(~). Thats could be the culprit that made the script unusable. If you want to change dir, give the full path like /home/scripts/projects/ instead of ~/projects .It makes a lot more difference.
To achieve your goal, there are several ways. Being a Senior Systems Engineer , I use different methodology to achieve such things which depends on the situations. Well here I list some of many ways.
1) Basic way what you tied and not succeeded .
chmod a+x /etc/init.d/webserver
update-rc.d webserver defaults
2) Add a cron job at reboots.
3) Add your commands to rc.local file before the last line exit 0.