LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-11-2011, 09:19 AM   #1
ksmatthews
Member
 
Registered: Aug 2008
Posts: 86

Rep: Reputation: 15
dyndns and virtual domains


HI All,

I have been able to access my laptop based web server from the 'other' side of my default gateway router using dyndns address like this ...

harry.dyndns-work.com

My web apps on the laptop have been set up using apache virtual domains and there are about 10 of them. The landing page of http://harry.dyndns-work.com seems to take me to first of these domains in alphabetical order..

domain dev.alonso.org

I would like to know how I can access each of these different domains using harry.dyndns-work.com ?

Does anyone have any ideas ?

Steven M
 
Old 06-11-2011, 09:39 AM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

As I can understand you have a web server that is hosting the site harry.dyndns-work.com. But when you access the site it displays you a list of virtual domains that you have configured so when you access the site http://harry.dyndns-work.com it shows something like this:

1. abcdomain
2. defdomain
3. ghidomain

and so on...

I would have suggested for the re-direction but that will create a problem as we have got multiple choices and we are not re-directing to a single destination rather we want it for different destination.

What you can try is creating either A record (alias will not work because we have got different destinations) for separate domains in dns server and that will look as follows:

abcdomain.harry.dyndns-work.com

It would be useful if you have elaborated a little more in how you have setup the virtual hosts and how the main page appears when you connect to http://harry.dyndns-work.com

Last edited by T3RM1NVT0R; 06-11-2011 at 09:40 AM.
 
Old 06-11-2011, 10:13 AM   #3
ksmatthews
Member
 
Registered: Aug 2008
Posts: 86

Original Poster
Rep: Reputation: 15
Hi THere,

RE As I can understand you have a web server that is hosting the site harry.dyndns-work.com. But when you access the site it displays you a list of virtual domains that you have configured so when you access the site http://harry.dyndns-work.com it shows something like this:

No that is NOT the case. I set up a free DNS name with http://www.dyndns.com/ that is called 'harry.dyndns-work.com'

When I enter http://harry.dyndns-work.com/ into my browser all port 80 traffic from to my DG (public side) is routed to my humble laptop. I guess my laptop interprets the request as 'http://localhost'. Problem is localhost is not set to point anywhere since I have 10 apache virtual domains set up each with their own config file and unique servername.

The landing page of http://harry.dyndns-work.com seems to take me to first of these domains - dev.alonso.org and displays the contents of it.

None of my domains are called 'harry.dyndns-work.com'

I hope this clarifies things,

Steven M

Last edited by ksmatthews; 06-11-2011 at 10:14 AM.
 
Old 06-11-2011, 11:49 AM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
You could use redirection. You can only point the dynDNS domain to one ip address, and that is your isp defined public ip. The first apache virtual domain is the default site that gets used if no other domain is specified in the http request.

You could put some redirection rules in an .htaccess file in the document root of the first virtual domain, such that browsing to http://harry.dyndns-work.com/alonso will redirect to that virtual site, and http://harry.dyndns-work.com/domain2 will redirect queries to that virtual site.

Because you must use the harry.dyndns-work.com domain from the outside, each virtual site should use relative links within itself, so that there are no browser redirects to non-externally visible domains.

http://perishablepress.com/press/200...s-tricks/#red4

or

Webcluster through Homogeneous URL Layout

Last edited by smoker; 06-11-2011 at 11:52 AM.
 
Old 06-12-2011, 06:58 AM   #5
ksmatthews
Member
 
Registered: Aug 2008
Posts: 86

Original Poster
Rep: Reputation: 15
Thanks Smoker,

RE You could put some redirection rules in an .htaccess file in the document root of the first virtual domain, such that browsing to http://harry.dyndns-work.com/alonso will redirect to that virtual site, and http://harry.dyndns-work.com/domain2 will redirect queries to that virtual site.

How would I be able to do that without changing the URL after redirection ?
For example http://harry.dyndns-work.com/alonso/.htaccess contains this ...

Redirect 301 / http://dev.alonso.com

That will certainly change the URL which will not be accessible on the public side of the DG ...

I need to redirect to the new content without a URL re-write ...

Any thoughts ?

Steven M
 
Old 06-12-2011, 08:10 AM   #6
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
A 301 redirect will not work because that 301 message is passed back to the browser, which will not be able to access a non-publicly accessible domain.

I think the easiest solution for you would be to create symlinks inside the http://harry.dyndns-work.com/ document root.

i.e.
Code:
ln -s /path/to/alonso/document/root alonso
so when you browse to http://harry.dyndns-work.com/alonso you will actually be accessing files inside the dev.alonso.com document root.
 
Old 06-12-2011, 10:06 AM   #7
ksmatthews
Member
 
Registered: Aug 2008
Posts: 86

Original Poster
Rep: Reputation: 15
Thanks Smoke,

That works a charm ...

I will need to test it out first thing tomorrow,

Thanks,

Steven Matthews
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure Sendmail + 1 dyndns.org free domain + Mysql for virtual server simon.unix Linux - Server 1 04-15-2009 12:23 PM
apache virtual domains CaSBoY Linux - Networking 5 07-26-2006 11:44 AM
Freeradius and Virtual Domains chinitobutnotchinese Linux - Security 0 06-29-2005 07:54 AM
Virtual Hosts with Dynamic IP and dyndns.org lexton Linux - Networking 1 08-11-2004 04:06 AM
Virtual Domains gene_gEnie Linux - Networking 2 09-16-2001 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration