I installed apache2 on ubuntu. I added the next to /etc/apache2/httpd.conf file

ScriptAlias /cgi-bin/ "/home/PROJECT/cgi-bin/"

I can open the cgi file basically copy the cgi file to /usr/lib/cgi-bin/hello.cgi[DocumentRoot directory] and access the URL http://localhost/cgi-bin/hello.cgi, however i get cannot access the file basically place it in /home/PROJECT/cgi-bin/hello.cgi despite the fact that ScriptAlias is placed and apache2 restarted.

Any factor that i'm missing here ?

I'd exactly the same problem. The main reason is at httpd.conf, I needed to remove global

ScriptAlias /cgi-bin/ /var/www/cgi-bin/

otherwise everything beginning /cgi-bin/ fell into /var/www/cgi-bin/.