traliing slash in URL path configuration

Karl DeBisschop karl at debisschop.net
Tue Mar 2 06:27:34 CET 2004


On Tue, 2 Mar 2004 15:11:08 +1100 
"Yao, Jack" <jyao at aav.com.au> wrote:

> Hi Karl  [and all others Nagios list Members],
> 
> Ah.. It is just not about how much workload server will have only, I
> am afraid.  I am also curious that in nagios document, it states very
> clear that by changing the URL html path from "/nagios/" to be
> "/nagios" in cgi.cfg and make the Alias in httpd.conf to be without
> trailing slah as well. The browser should then accept the user to type
> http://mydomain.com/nagios  and redirect to
> http://mydomain.com/nagios/  

cgi.cfg does not affect what the browser accepts - only what is
presented to the browser.

As I said, I took the config from the RPM, deleted the trailing slash,
and reloaded httpd. No more. Really.

> But what happen to me now is that, after I have done all the changed
> as described in the document, the browser still don't accept user to
> type http://mydomain.com/nagios .  Whenever user types
> 	http://mydomain.com/nagios
> it will reditect to http://_default_/nagios   and display "page
> cannot be display error, server not found.."  

The redirect to _default_ is even more suggestive that there are
issues with in your httpd.conf file. If this were just a simple
httpd.conf file, I think you'd see

	The requested URL /nagios was not found on this server.

The 'server not found' error suggests there's more happening in your web
server configs than just the nagios config. I repeat, find the person in
your office who really knows your apache configs. This really does not
seem to be a nagios issue - it's an apache issue.

> And browser still only accept user to type http://mydomain.com/nagios/
> as if the changes in cgi.cfg and in httpd.conf did not have any effect
> at all.



> 
> I guess the 2 majot questions here are:
> 
> 1.  Do I miss any other part of configuration that might state
> somewhere else in the document but I did not see it ?

No. Unless there are pre-existing oddities in your httpd.conf, deleting
the trailing slash in the alias really is all you need to do. I swear.

> 2. Or Does the document not cover everything as it should be ?

Again, I took the RPM install, and deleted one slash, then reloaded.
Nothing more.

> And I don't think it is Apache issue as the url
> http://mydomain.com/nagios/
> still works fine, so the Apache is definitely working, as well as
> Nagios.

I understand that apache is working, but it appears to me that some
other directive prevents your changes from being seen. 

> And I notice that you use the path in the Alias set up as Alias
> /nagios/usr/share/nagios/ , while the one I am using now is Alias
> /nagios/usr/local/nagios/share  , is that a typo or it is actually
> different path???

Because I used the rpm, which does not install into /usr/local - it
installs into /usr and trys to follow the FHS, instead of the GNU
guidelines. (If you want to try the RPM, run rpmbuild -ta on the tarball
- but I think it will make no difference. I think you need to take a
better look at other directives in your apache config that may interfere
with the alias you are trying to establish.)

> 
> -----Original Message-----
> From: Karl DeBisschop [mailto:karl at debisschop.net] 
> Sent: Tuesday, 2 March 2004 1:46 PM
> To: Yao, Jack
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] traliing slash in URL path configuration
> 
> 
> On Tue, 2 Mar 2004 12:00:41 +1100
> "Yao, Jack" <jyao at aav.com.au> wrote:
> 
> > Hi all ,
> >  
> > sorry that I have to keep asking the same question again. Basically
> > , on Redhat 8.0 and Apache, I 've been trying to change the default
> > URL from http://mydomain.com/nagios/ <http://mydomain.com/nagios/>  
> > to be http://mydomain.com/nagios <http://mydomain.com/nagios>  .   
> > And here are the changed I've done so far , which still don't work
> > by the way.
> 
> I use the RPM which (on FC1) puts nagios.conf in /etc/httpd/conf.d so
> it is automatically included in the httpd.conf file.
> 
> I changed 
> 
> 	Alias /nagios/ /usr/share/nagios/
> 
> to
> 
> 	Alias /nagios /usr/share/nagios/
> 
> and restarted the server. Then I entered the URL 
> 
> 	http://localhost/nagios
> 
> It automatically redirected to 
> 
> 	http://localhost/nagios/
> 
> as expected.
> 
> > So basically it don't matter what I do to the file cgi.cfg and 
> > httpd.conf[and of course reload/restart the related services after
> > the changes], the only URL that work is still the same one, so Is
> > there anything else I am missing here ???
> 
> If http://host/nagios won't work, there's something else interfering
> with you httpd config. Take it up with your local apache guru who
> probably knows your configs better than I do.
> 
> If you are expecting http://host/nagios to become the default URL, I
> don't think you are ever going to get that. I believe that you only
> get to completely drop the trailing slash when referring to a file,
> not a directory. That is the reason that supporters of the bandwidth
> conservation movement advocate leaving the trailing slash in the
> configs- since the URL will redirect to include the trailing slash,
> you have force a redirect eating up bandwidth and response time. If
> you leave the slash in the configs, you force your documentation
> writers to use it and your users get faster responses while your
> server does less work. Of course, how you config your server is
> entirely up to you. But I'm pretty sure that without a rewrite rule,
> your default URL will retain the trailing slash, even when you accept
> input without the trailing slash.
> 
> --
> Karl


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list