I've an apache install on my small local machine and my project is situated at:

http://localhost/my/dir/

and I must can get on by typing:

http://projectname/

How's this accomplished in apache?

you will need to produce a virtualhost. Have a look only at that:

http://httpd.apache.org/docs/2.0/vhosts/examples.html

Next, you will have to add an entry to your hosts file to suggest projectname to localhost.