Recently I needed to install NCBI wwwblast on my local workstation to enable some software that needed to interface with BLAST via the web service. It was straightforward to install, but I took some notes, because there were a few changes required with respect to the official wwwblast documentation at NCBI. These instructions are for Ubuntu 8.04, but probably will work with many recent flavours of Debian.
Download and install
Download NCBI wwwblast from ftp://ftp.ncbi.nih.gov/blast/executables/LATEST/ (The version I used was wwwblast-2.2.18-ia32-linux.tar.gz).
Untar it into /var/www/ , preserving permissions.
$ cd /var/www/
$ sudo tar zxvpf wwwblast-2.2.18-ia32-linux.tar.gz
Set up Apache2
The instructions in the official wwwblast manual didn’t seem to work for Apache2 .. (could be a typo: Follow SymLinks should be FollowSymLinks … one camel-case word without the space). I put this in into the VirtualHost definition in the standard /etc/apache2/sites-available/default file used by Apache2 in Ubuntu 8.04.
#http://www.ncbi.nlm.nih.gov/staff/tao/URLAPI/wwwblast/node10.html
<Directory "/var/www">
AddHandler cgi-script cgi REAL
Options Indexes FollowSymLinks MultiViews +ExecCGI
Order allow,deny
Allow from all
</Directory>
The code above was inserted just before the </VirtualHost> closing tag.
Restart Apache for good measure.
$ sudo /etc/init.d/apache2 restart
Configure your wwwblast to see your databases
Assuming you already have some existing BLAST formatted databases made with formatdb, you will then need to configure wwwblast to find them, as per the manual. In short, this involves putting the BLAST database files into /var/www/blast/db/ (or symlinking to the files), modifying /var/www/blast/blast.rc (or one of the other *.rc files, for other BLAST programs, eg psiblast) to associate the database name with a BLAST program, and modifying the dropdown database list in /var/www/blast/blast.html (or one of the other *.html files for other BLAST programs) to add the name of the database(s).
My BLAST databases live in /data/databases/blast/, so I simply moved the example database directory /var/www/blast/db to /var/www/blast/db.orig:
$ sudo mv /var/www/blast/db /var/www/blast/db.orig
then symlinked /var/www/blast/db to /data/databases/blast:
$ sudo ln -s /data/databases/blast /var/www/blast/db
In /var/www/blast/blast.rc I changed the line:
blastp test_aa_db
to:
blastp nr swissprot pdbaa
(you may also want to configure blastn etc in the same way)
In /var/www/blast/blast.html, I changed the test database code:
<option VALUE = "test_aa_db"> test_aa_db
<option VALUE = "test_na_db"> test_na_db
</select>
to:
<option VALUE = "nr"> nr
<option VALUE = "swissprot"> swissprot
<option VALUE = "pdbaa"> pdbaa
</select>
(you may want to do this for other BLAST programs too, eg also edit psiblast.html)
This will allow be to search the nr, swissprot and pdbaa databases I have installed using plain-vanilla BLAST.
Test it out
Go to http://localhost/blast/blast.html.
You should find the wwwblast interface, with a dropdown box featuring the database(s) you added. Run a test search with your favorite sequences (ensure you also select the correct blast program, eg blastp !). Enjoy using your own CPU time !


thanks a lot! i have been struggling a bit with setting up a BLAST server for my lab, and this helped
Glad it was useful !
This question is more for xander: I am a research fellow at NIH and I was wondering if NIH supports Ubuntu. Many Institutes offer support for Red Hat Enterprise but I am an Ubuntu fan (who had before Fedora and Red Hat but then I switched to Ubuntu).
Radu: I’m not at NIH, but I visitd there for a few months last year. They were apparently _allowed_ to install and use Ubuntu if they needed it, but I’m unsure if it is _officially_ supported.
Hi,
great post, thanks for sharing! However, I’m having an Apache2 related (I think) configuration problem:
I keep getting a “Forbidden You don’t have permission to access /blast/blast.cgi on this server.” message when trying to run the scripts (via the Search button). At this stage I’ve even tried chmod ugo+rwx on all files but no success. I did uncomment the AddHandler cgi-script .cgi line in /etc/apache2/mods-available/mime.conf.
This is my /etc/apache2/sites-available/blast (the /etc/apache2/sites-available/default left unchanged):
DocumentRoot /var/www/
AddHandler cgi-script cgi REAL
Options Indexes FollowSymLinks MultiViews +ExecCGI
Order allow,deny
Allow from all
Any help most welcomed!
Thanks,
Johan
Not 100 % sure what’s causing that problem (unfortunately your config text got munged by the blog due to html-like tags). Here are a few ideas:
As a test, are you able to try putting the block of <Directory> config stuff just before the closing </VituralHost> tag in your /etc/apache2/sites-available/default file ? I can see why you may want it in a separate site definition like /etc/apache2/sites-available/blast (say you were running on some site off http://www.mydomain.com and you wanted blast accessible from wwwblast.mydomain.com), but testing it this way could help isolate the issue, since presumably regular cgi’s run fine from the default site.
Not sure if it matters, since it’s already defined the line AddHandler cgi-script cgi REAL, but you should try adding REAL to the uncommented AddHandler line in /etc/apache2/mods-available/mime.conf too.
Sorry I can’t be of more help … I wouldn’t claim to be an Apache expert
Perry!
Thanks for the suggestions. I’ve basically tried those but the problems is probably somewhere else on my setup. I tried your original instructions on a different computer with a fresh Ubuntu installation and it worked perfectly. Have to find time to repair the other server someday…
Thanks afain for your reply.
Cheers
Johan