What you'll need is the Apache VirtualHost directive.
See the Apache Documentation and some Examples.
Basically what you want to do in Ubuntu is to make sure, that the port you want to use (usually :80) is enabled in /etc/apache2/ports.conf like this:
NameVirtualHost *:80
Listen 80
Next you'll have to create a new conf-file in /etc/apache2/sites-available.
I'd suggest to name it proj1.conf or proj1.mydomain.conf.
There you can configure the VirtualHost as follows:
<VirtualHost *:80>
ServerName proj1.subdomain.domain.com
DocumentRoot /var/www/proj1
ServerAdmin name@domain.com
# Write a seperate log per Virtualhost
CustomLog /var/log/apache2/proj1.subdomain.access_log combined
ErrorLog /var/log/apache2/proj1.subdomain.error_log
# Maybe you want to put some restrictions on the directory
<Directory /var/www/proj1>
Options -Indexes +FollowSymLinks + Includes
AllowOverride All
# Restrict Access to certain IP's
Order Deny,Allow
Deny from All
Allow from 127.0.0.1 IP IP IP
Satisfy ALL
</Directory>
</VirtualHost>
Consult the Apache Manual to see what you could do with the Directive.
To enable this Site, link it to /etc/apache2/sites-enabled
ln -s /etc/apache2/sites-available/proj1.conf /etc/apache2/sites-enabled/proj1
Now all you have to do is make sure your config is valid and then restart Apache:
apache2ctl configtest && /etc/init.d/apache2 restart
Naturally you will have to set up the subdomain in your DNS in a way that it points to this server.