Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Mar 22, 2005 1:43 am 
Offline
Junior Member
User avatar

Joined: Wed Aug 13, 2003 1:25 pm
Posts: 27
Hi,

I need some help on how to do this configuration on my apache.

- All instance are running on a single IP address on my Linode.
- http://mydomain1:80 point to Doc_root_1
- http://mydomain1:8080 point to Doc_root_2

Now, I wasn to get a new domain, say mydomain2 so that http://mydomain2:80 will be just alias for http://mydomain1:8080

Is this possible? If so, how would my httpd.conf entries looks like? Since I want to give an option for my user to just use the mydomain2 to bring up whatever Doc_root_2 that was originally running on port 8080 of mydomain1

Thanks.


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2005 2:10 am 
Offline
Senior Member

Joined: Sun Nov 14, 2004 6:37 pm
Posts: 138
Website: http://oldos.org
WLM: jasonlfaulkner@hotmail.com
Yahoo Messenger: jasonfncsu
AOL: jaylfaulkner
Location: NC, USA
Do you *have* to run the other on another port?

_________________
Jay Faulkner
http://oldos.org


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2005 2:20 am 
Offline
Junior Member
User avatar

Joined: Wed Aug 13, 2003 1:25 pm
Posts: 27
Yes, that's how ports are allocated to different developers with the team.

Is this do-able? Thanks.


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2005 4:20 am 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
Try this:
Code:
NameVirtualHost aaa.bbb.ccc.ddd:80
NameVirtualHost aaa.bbb.ccc.ddd:8080
# where aaa.bbb.ccc.ddd is the IP address of your server

<VirtualHost aaa.bbb.ccc.ddd:80>
    ServerName mydomain1.com
    DocumentRoot /path/to/doc_root_1
</VirtualHost>

<VirtualHost aaa.bbb.ccc.ddd:8080>
    ServerName mydomain1.com
    DocumentRoot /path/to/doc_root_2
</VirtualHost>

<VirtualHost aaa.bbb.ccc.ddd:80>
    ServerName mydomain2.com
    DocumentRoot /path/to/doc_root_2
</VirtualHost>


You will need ServerAlias entries in each VirtualHost block for any other host names that they should respond to. Unaliased host names will use the first (default) VirtualHost entry.

_________________
/ Peter


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2005 4:19 pm 
Offline
Junior Member
User avatar

Joined: Wed Aug 13, 2003 1:25 pm
Posts: 27
Thanks for the information. I will see how it goes.

Forgot to mentsion one thing.... I am trying to do this a my work location as well.

The setting are:

Host1 (with different ports assign to different developers) is a BigIP which distribute the traffic to different web instance. For example host1:port1 could route to hostA:1, host1:port2 will route to hostB:port 2 So user will access their ports using host1:port_number and it will route all traffic to different A/B/C host with the same port number.

Will this conf work on this case as well? Given that the conf that I have are on hostA/B/C, not on Host1.

Thanks.


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2005 4:31 pm 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
The VirtualHost directives map hostnames (as specified in the HTTP headers) and (optionally) port numbers to document roots. As long as the forwarding server leaves the HTTP headers intact, you can put VirtualHost directives on the A/B/C servers to direct the incoming requests to the correct document root based on requested server name and (optionally) the port that the request was delivered to. If the forwarding server rewrites the HTTP headers, then this scheme will not work.

_________________
/ Peter


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2005 5:20 pm 
Offline
Senior Newbie
User avatar

Joined: Wed Jun 25, 2003 11:50 am
Posts: 6
ICQ: 29649862
WLM: chris@chriswatt.co.uk
Yahoo Messenger: chriswattcouk
Location: United Kingdom
When using a BigIP there should be no need to configure Apache Virtuals, You can set the big ip to accept the connections and filter/direct the traffic to the desired server/port. It has been some time since I have worked with a big IP so can't remember exactly how to do this, but know I have used it many times.

Chris


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2005 5:21 pm 
Offline
Junior Member
User avatar

Joined: Wed Aug 13, 2003 1:25 pm
Posts: 27
Thanks for help, Peter.

For the NameVirtualHost, should I use the IP address of Host1 (the forwarding host) or the IP of A/B/C host itself?

Thanks.


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2005 5:33 pm 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
komy wrote:
For the NameVirtualHost, should I use the IP address of Host1 (the forwarding host) or the IP of A/B/C host itself?

Specify the IP address of the physical interface on the machine which will be servicing the requests (i.e. your A/B/C host).

_________________
/ Peter


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group