Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 26493 invoked from network); 23 Oct 2003 11:21:24 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 23 Oct 2003 11:21:24 -0000 Received: (qmail 80940 invoked by uid 500); 23 Oct 2003 11:21:10 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 80926 invoked by uid 500); 23 Oct 2003 11:21:10 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 80913 invoked from network); 23 Oct 2003 11:21:10 -0000 Received: from unknown (HELO web9908.mail.yahoo.com) (216.136.129.251) by daedalus.apache.org with SMTP; 23 Oct 2003 11:21:10 -0000 Message-ID: <20031023112110.80629.qmail@web9908.mail.yahoo.com> Received: from [204.116.182.217] by web9908.mail.yahoo.com via HTTP; Thu, 23 Oct 2003 04:21:10 PDT Date: Thu, 23 Oct 2003 04:21:10 -0700 (PDT) From: CJ To: users@httpd.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: RE: [users@httpd] need help with ip addr not resolving to www name. X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Thank you all for the good information. � I will try setting up virtual hosts and let you know how it goes. I do not have any defined at this time and after reading all the responses it seems I need at least 2 of them to get the redirect to work right. � I thought the ServerName took care of this based on the e comments int eh file. I learn something new every day. � I'll write back and let you know how it goes shortly. Boyle Owen wrote: Plain text please... I think you might be misunderstanding the function of the ServerName directive. It is used by apache to match INCOMING requests to the appropriate virtual host. It is not "returned" to the client... Assuming http, a URL consists of two parts: http://host/localinfo - The "host" can be a fully-qualified domain name, like www.amazon.com, a machine name on the local network, or a bare IP address. It may or may not include a port number - if it doesn't, port 80 is assumed. In any case, it must resolve to an IP address. - The "localinfo" is the path to the file you want from the DocumentRoot of the VH defined by the "host". If your link contains an IP address as the Host, then when the request arrives at apache, it will have no "host" information. If you have several name-based VHs, apache will not be able to match it to any particular one and so will serve the first VH by default. If you have only one VH, it will serve that one. Note that apache just serves files - it doesn't tell the client anything about the VH configuration... However, the way to get things to work the way you want is to set up name-based virtual hosting with two VHs. One is your "real" VH with the "real" ServerName and the other, which must come first, is a dummy VH with a fake ServerName. The dummy VH then redirects all traffic to the real VH. E.g. NameVirtualHost * # Fake VH to trap host-less requests ServerName dummy-fake Redirect / http://www.your-server.com/ # Real VH ServerName www.your-server.com DocumentRoot /path/to/real/site ...etc. So what happens is: - request comes in with no host header - doesn't match VH1 (servername = dummy-fake) - doesn't match VH2 (servername = www.your-server.com) - so apache serves VH1 by default - VH1 says, redirect to www.your-server.com - apache sends 301 Redirect to the browser - browser receives the redirect and changes display to read www.your-server.com - new request comes in WITH host header = www.your-server.com - doesn't match VH1 (servername = dummy-fake) - matches VH2 so browser gets that data. Rgds, Owen Boyle Disclaimer: Any disclaimer attached to this message may be ignored. -----Original Message----- From: CJ [mailto:unix1adm@yahoo.com] Sent: Donnerstag, 23. Oktober 2003 02:21 To: users@httpd.apache.org Subject: [users@httpd] need help with ip addr not resolving to www name. How can I get apache to not return the IP address of my server. I have links that go to an address of http://123.123.123.123/index.html but when you click on the link in the browser address it shows the ip addr not the domain name. I have defined the server in the httpd.conf file to be ServerName www.mydomain.com but it still show the IP addr. Stopped and restarted the apache server etc. The environment is such that the initial page is hosted on a 3rd party www server and it has links back to the real server. The links work fine just the IP addr is the problem. There are two major products to come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence. Blessed are the pessimists, for they make backups! Tell me and I forget. Show me and I remember. Involve me and I learn." 10101010011100101001001000011010000001000100101010101010 0011001010100010110010101000010001010000 Do you Yahoo!? The New Yahoo! Shopping - with improved product search Diese E-mail ist eine private und pers�nliche Kommunikation. Sie hat keinen Bezug zur B�rsen- bzw. Gesch�ftst�tigkeit der SWX Swiss Exchange. This e-mail is of a private and personal nature. It is not related to the exchange or business activities of the SWX Swiss Exchange. Le pr�sent e-mail est un message priv� et personnel, sans rapport avec l'activit� boursi�re de la SWX Swiss Exchange. This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org ===== There are two major products to come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence. Blessed are the pessimists, for they make backups! Tell me and I forget. Show me and I remember. Involve me and I learn." 10101010011100101001001000011010000001000100101010101010 0011001010100010110010101000010001010000 __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org