Server Name configuration???
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Web Servers on Unix and Linux > Server Name configuration???




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Server Name configuration???  
Chow


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-11-04 07:49 AM

Hello Gurus,

I have a question about my hostname setup for my webserver and
application server on my redhat 7.2 linux machine with Apache HTTPD
server 1.3 version.

I want to understand how actually browser resolves the hostname
part of the request url when a request is posted. For example we have
two url's,

One is absolute URL,

http://hostname/sampleuri/test.html

and other is relative URL,

/sampleuri/test.html

for say in a simple web page when we have two links to the above
two urls both resolve to

http://hostname/sampleuri/test.html ( assuming http://hostname is
where the request came from in the second case).

I want to know if we have to configure something in the system
properties in the OS like in /etc/hosts file or somewhere to do that.

I want to know how the browser actually get the hostname part of
the complete URL in the second case (Relative URL) and forms a
qualified URL to the resource. Please check the below url for my
question ( See the source of the file if you want to see the HTML
code)

http://www.geocities.com/cnadella/

http://geocities.com/cnadella/

Observe the second url's full path to see the difference for above
two request URLs.

I really don't if it is a system level configuration or a
webserver/application server level configuration. Please help me
understand this if anybody knows about it.

Thanks a lot in advance.


Cheer,

Nadella





[ Post a follow-up to this message ]



    Re: Server Name configuration???  
David Efflandt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-13-04 12:48 PM

On 10 Aug 2004 20:31:40 -0700, Chow <cnadella@excite.com> wrote:
> Hello Gurus,
>
>     I have a question about my hostname setup for my webserver and
> application server on my redhat 7.2 linux machine with Apache HTTPD
> server 1.3 version.
>
>     I want to understand how actually browser resolves the hostname
> part of the request url when a request is posted. For example we have
> two url's,
>
>      One is absolute URL,
>
>         http://hostname/sampleuri/test.html
>
>      and other is relative URL,
>
>          /sampleuri/test.html

I believe that would be called a full (or absolute) URI, not relative.  In
this case the full URL is constructed by the browser based on the hostname
used to access the page (or meta base href tag, if there is one).

A "relative" URI would not begin with "/".  Relative would be relative to
current path, for example "test.html" from anything in
http://hostname/sampleuri/ would point to
http://hostname/sampleuri/test.html, or "otherdir/test.html" would point
to http://hostname/sampleuri/otherdir/test.html.  And a link to
"test2.html" from that last path would point to
http://hostname/sampleuri/otherdir.test2.html

One gotcha is if the server redirects the request using its ServerName
instead of the browser's Host header (especially if the browser cannot
resolve that set or assumed ServerName).  See apache docs for
UseCanonicalName.

As long as you have UseCanonicalName off, the set ServerName or hostname
of the machine usually does not matter.  However, in my case I
specifically set a bogus Servername (along with UseCanonicalName off), so
any Host requests other than ServerName or ServerAlias for my set virtual
hosts go to my default name based virtual host (worm trap), because
otherwise the virtual host that matched my real hostname would not work
properly.

--
David Efflandt - All spam ignored  http://www.de-srv.com/





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:58 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register