Apache2 configuration

Hello,
I am trying to understand the basic of Apache when I met problem each time I restart apache.
How to solve the problem when I need put a second ScriptAlias line in my "/etc/apache2/sites-enabled/000-default" file:

16    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
17 <Directory "/usr/lib/cgi-bin">
 18           AllowOverride None
 19           Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
 20           Order allow,deny
 21           Allow from all
 22      </Directory>

 41      ScriptAlias /cgi-bin/ /var/www/blast/
 42      <Directory "/var/www/blast">
 43           AddHandler cgi-script cgi REAL
 44           AllowOverride None
 45           Options Indexes FollowSymlinks +ExecCGI MultiViews +SymLinksIfOwnerMatch
 46           Order allow,deny
 47           Allow from all
 48      </Directory>

$ sudo /etc/init.d/apache2 restart

* Restarting web server apache2                                                                                                                            [Fri Nov 16 14:21:37 2012] [warn] The ScriptAlias directive in /etc/apache2/sites-enabled/000-default at line 41 will probably never match because it overlaps an earlier ScriptAlias.
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
 ... waiting [Fri Nov 16 14:21:38 2012] [warn] The ScriptAlias directive in /etc/apache2/sites-enabled/000-default at line 41 will probably never match because it overlaps an earlier ScriptAlias.
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

$

My understanding is the first ScriptAlias is the default of my Ubuntu box. But The second ScriptAlias of line 41 is needed for my program. Do they conflict each other? Thanks a lot!
Yifang

You have duplicate

 /cgi-bin/

Thanks hydn!
Then how do I set up the second scripalias for my /var/www/blast ? Can you give me more details? I am a beginner with apache.

You don't need the first, by default its only there if you want to use it. So you could have setup thing under that path. But since you created /var/www/blast/ ...comment out line 16 - 22

1 Like

Actually line 16~22 are for my other cgi script like perl cgi stuff, and the 41~48 for my blast function. If 16~22 are commented, perl-cigi would not work, right? I have to say both are cgi, so far I am trying those functions in my localhost. Thanks again! yt

For multiple directories make a .htaccess on the directory you want to enable CGI content putting the option:

+ExecCGI

and obviously you should have the AllowOverride set to all on the apache�s configuration file for that directory. eg::

<Directory/var/www/blast>
AllowOverride all
</Directory>

Thanks Hydn!
That's the part I have been struggling with. Actually I had to scratch from the beggining by reading the Apache2 manual, where I easily got lost and do not know where to start. Normally I want to configure apache to use perl-script CGI, shell-script cgi, and then this blast cgi under /var/www/blast. I only know perl-cgi should be put in /usr/lib/cgi-bin. How to customize my apache configuration?

For multiple directories make a .htaccess on the directory you want to enable CGI content putting the option:
+ExecCGI

Which directory should I put the .htaccess file? I am lost with your statement. Thanks again!