You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by akhayyami <ak...@hotmail.com> on 2007/05/06 21:41:56 UTC

[users@httpd] Unwanted URL rewriting - apache replaces server name with ip in address bar

  I have a problem with one of my servers; When I enter
http://www.myserver.com in address bar (IE & Firefox), apache replaces the
server name (e.g. www.myserver.com) with an ip address. I tried with &
without virtual hosts but no chance. I also tried UseCanonicalName with yes
& no. How can I disable this?
This is my virtualhost config:

NameVirtualHost 1.2.3.4:80

<VirtualHost 1.2.3.4:80>
        ServerName www.myserver.com
        UseCanonicalName Off
        ServerAlias myserver.com
        ServerAlias 1.2.3.4
        CustomLog     /etc/httpd/logs/myserver-access.log combined
        ErrorLog      /etc/httpd/logs/myserver-error.log
        LogLevel info
        DocumentRoot /home/tomcat/webapps
        DirectoryIndex index.html index.htm index.shtml index.jsp
        JkAutoAlias /home/tomcat/webapps

        JkMount /*.jsp ajp13

        JkMount /servlet/* ajp13
        JkMount /*.do ajp13
        # Deny direct access to WEB-INF
        <LocationMatch ".*WEB-INF.*">
                deny from all
        </LocationMatch>
</VirtualHost>


Thanks.
-- 
View this message in context: http://www.nabble.com/Unwanted-URL-rewriting---apache-replaces-server-name-with-ip-in-address-bar-tf3700638.html#a10348497
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Re: [users@httpd] Unwanted URL rewriting - apache replaces server name with ip in address bar

Posted by akhayyami <ak...@hotmail.com>.
You are right Krist;
  our network administrator had made a mistake in configuring DNS settings
for our server.
Thanks.


Krist van Besien wrote:
> 
> On 5/6/07, akhayyami <ak...@hotmail.com> wrote:
>>
>>   I have a problem with one of my servers; When I enter
>> http://www.myserver.com in address bar (IE & Firefox), apache replaces
>> the
>> server name (e.g. www.myserver.com) with an ip address. I tried with &
>> without virtual hosts but no chance. I also tried UseCanonicalName with
>> yes
>> & no. How can I disable this?
> 
> It is probably not apache that is doing this. A browser will change
> the adress line when it gets a "redirect" as response to its request.
> This redirect could wel be generated by your tomcat application.
> Use firefox with the "LiveHTTPHeaders" extention to see where you are
> getting redirects.
> 
> Krist
> 
> 
> -- 
> krist.vanbesien@gmail.com
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What's wrong with top-posting?
> A: Top-posting.
> Q: What's the biggest scourge on plain text email discussions?
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Unwanted-URL-rewriting---apache-replaces-server-name-with-ip-in-address-bar-tf3700638.html#a11362434
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Re: [users@httpd] Unwanted URL rewriting - apache replaces server name with ip in address bar

Posted by Krist van Besien <kr...@gmail.com>.
On 5/6/07, akhayyami <ak...@hotmail.com> wrote:
>
>   I have a problem with one of my servers; When I enter
> http://www.myserver.com in address bar (IE & Firefox), apache replaces the
> server name (e.g. www.myserver.com) with an ip address. I tried with &
> without virtual hosts but no chance. I also tried UseCanonicalName with yes
> & no. How can I disable this?

It is probably not apache that is doing this. A browser will change
the adress line when it gets a "redirect" as response to its request.
This redirect could wel be generated by your tomcat application.
Use firefox with the "LiveHTTPHeaders" extention to see where you are
getting redirects.

Krist


-- 
krist.vanbesien@gmail.com
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Re: [users@httpd] Unwanted URL rewriting - apache replaces server name with ip in address bar

Posted by Victor Trac <vi...@gmail.com>.
This may not help you, but NameVirtualHost 1.2.3.4 says that you want
to use that IP for name based virtual hosts.  However, you've got a
Serveralias 1.2.3.4 which means that you want this IP also respond to
your VirtualHost (i.g. you are really trying to do a IP based
virtualhost).  You don't need the NameVirtualHost line, nor do you
need the ServerAlias 1.2.3.4 line if you are only hosting on site on
1.2.3.4.

--Victor

On 5/6/07, akhayyami <ak...@hotmail.com> wrote:
>
>   I have a problem with one of my servers; When I enter
> http://www.myserver.com in address bar (IE & Firefox), apache replaces the
> server name (e.g. www.myserver.com) with an ip address. I tried with &
> without virtual hosts but no chance. I also tried UseCanonicalName with yes
> & no. How can I disable this?
> This is my virtualhost config:
>
> NameVirtualHost 1.2.3.4:80
>
> <VirtualHost 1.2.3.4:80>
>         ServerName www.myserver.com
>         UseCanonicalName Off
>         ServerAlias myserver.com
>         ServerAlias 1.2.3.4
>         CustomLog     /etc/httpd/logs/myserver-access.log combined
>         ErrorLog      /etc/httpd/logs/myserver-error.log
>         LogLevel info
>         DocumentRoot /home/tomcat/webapps
>         DirectoryIndex index.html index.htm index.shtml index.jsp
>         JkAutoAlias /home/tomcat/webapps
>
>         JkMount /*.jsp ajp13
>
>         JkMount /servlet/* ajp13
>         JkMount /*.do ajp13
>         # Deny direct access to WEB-INF
>         <LocationMatch ".*WEB-INF.*">
>                 deny from all
>         </LocationMatch>
> </VirtualHost>
>
>
> Thanks.
> --
> View this message in context: http://www.nabble.com/Unwanted-URL-rewriting---apache-replaces-server-name-with-ip-in-address-bar-tf3700638.html#a10348497
> Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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
>
>


-- 
http://www.victortrac.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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