# Problem with adding ScriptAlias in nagios



## rhinestone89 (May 4, 2010)

Hello Everyone, I have a problem when I add the ScriptAlias and Alias of Nagios in apache. 
I think some guys might be familiar of this script:


```
ScriptAlias /nagios/cgi-bin/ /usr/local/www/data/nagios/cgi-bin/
<Directory "/usr/local/www/data/nagios/cgi-bin/">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</Directory>

Alias /nagios /usr/local/www/data/nagios/

<Directory "/usr/local/www/data/nagios/">
Options None

AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</Directory>
```

the problem is that when i add this script in http.conf and restart apache, this is what freebsd shows me:


```
root@ciso-xenmaster /usr/local/etc/apache22]# nano httpd.conf /usr/local/etc/rc.d/apache22 resta
art
Performing sanity check on apache22 configuration:
[Tue May 04 07:35:04 2010] [warn] The ScriptAlias directive in /usr/local/etc/apache22/Includes/nagios.conf at line 23 will probably never 
match because it overlaps an earlier ScriptAlias.
[Tue May 04 07:35:04 2010] [warn] The Alias directive in /usr/local/etc/apache22/Includes/nagios.conf at line 24 will probably never match 
because it overlaps an earlier Alias.
Syntax OK
Stopping apache22.
Waiting for PIDS: 32842.
Performing sanity check on apache22 configuration:
[Tue May 04 07:35:06 2010] [warn] The ScriptAlias directive in /usr/local/etc/apache22/Includes/nagios.conf at line 23 will probably never 
match because it overlaps an earlier ScriptAlias.
[Tue May 04 07:35:06 2010] [warn] The Alias directive in /usr/local/etc/apache22/Includes/nagios.conf at line 24 will probably never match 
because it overlaps an earlier Alias.
Syntax OK
Starting apache22.
[Tue May 04 07:35:07 2010] [warn] The ScriptAlias directive in /usr/local/etc/apache22/Includes/nagios.conf at line 23 will probably never 
match because it overlaps an earlier ScriptAlias.
[Tue May 04 07:35:07 2010] [warn] The Alias directive in /usr/local/etc/apache22/Includes/nagios.conf at line 24 will probably never match 
because it overlaps an earlier Alias.
[root@ciso-xenmaster /usr/local/etc/apache22]#
```

Does anyone know how to fix this problem?? 
Another question is that, where location should I paste the script in http.conf?


----------



## lme@ (May 4, 2010)

Have you tried to change the order?
First Alias, then ScriptAlias.


----------



## rhinestone89 (May 4, 2010)

I tried changing their the script's order but still it's not working... do you have any idea on where to place the script? It might be that there's a proper place for it that will not cause any problem.


----------



## DutchDaemon (May 4, 2010)

1. Please post in the right forum -> Select the right forum for new threads
2. Please use proper formatting -> Posting and Editing in the FreeBSD Forums
3. A forum search might have helped -> http://forums.freebsd.org/showthread.php?t=13692


----------

