Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a cluster of Apache webservers using round-robin for primitive load balancing. Is there a way to have firefox or chrome request that server name from a specific IP?

If you just enter the http://1.2.3.4 , it doesn't get the ServerName, and if you enter http://servername, you could get any of the servers.

share|improve this question
    
Is the round-robin a sticky session type of connection to the back end server? –  djangofan May 18 '11 at 19:29
1  
Dmourati and Eduardo's answers are both spot-on. –  Hyppy May 18 '11 at 19:40
    
@djangofan : No--the servers are setup fully parallel with respect to session. If one drops off, any other server can resume the transaction. –  Bryan Agee May 18 '11 at 20:35

2 Answers 2

up vote 10 down vote accepted

I assume you mean DNS round-robin. In that case the basic way I can think of is to just edit your /etc/hosts to point to whatever backend you want to try in a particular moment:

1.2.3.4 servername

You may have to restart your browser afterwards to make sure it isn't used a cached DNS answer.

Also you could add additional entries in your DNS like servername-001, -002, etc. and configure your backends to accept those names as a ServerAlias for the VirtualHost you're aiming for. Of course you could also just set the VirtualHost as default so it works using the IP and omit this last step, assuming your App doesn't assume it's running with a particular name.

Edit: This may be useful - it's a Firefox extension that lets you modify request headers. You could arguably modify Host to visit the backends directly specifying a ServerName. I haven't tried it though.

https://addons.mozilla.org/en-us/firefox/addon/modify-headers/

share|improve this answer

You need to modify the HTTP Host header.

See:

http://en.wikipedia.org/wiki/List_of_HTTP_header_fields

I do this with curl:

curl -H host:servername http://1.2.3.4

You may find the following plugins useful:

https://addons.mozilla.org/en-us/firefox/addon/modify-headers/

https://addons.mozilla.org/en-US/firefox/addon/tamper-data/eula/33806

share|improve this answer
    
I edited my post with the same URL before seeing your contribution! Hope you don't mind. +1 for curl. –  Eduardo Ivanec May 18 '11 at 19:43
    
@Eduardo, not at all. I've been messing around with this exact problem lately and using the curl approach myself. Couldn't find anything useful for OP on the chrome front. –  dmourati May 18 '11 at 19:46
    
Definitely +1 for the curl tip. Thanks! –  Bryan Agee May 18 '11 at 23:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.