LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-19-2007, 06:13 AM   #1
laundry_day
LQ Newbie
 
Registered: May 2007
Posts: 9

Rep: Reputation: 0
Sub-domain name setup


I've been searching for a way to do this but can't seem to find anything that explains it in beginner's terms. You're my last hope!

Our schools main site (ex: domain.org) is setup with shared hosting (Bluehost). We have a Linux Debian server, with a Static IP address, setup at our school. It is running Tomcat/Nutch (for search development).

What we need is our search server to have the subdomain of search.domain.org . The webhost allows for subdomain forwarding and it's doing that ok. (search.domain.org points to our server.) Unfortunately, the address that appears in the browser is our Static IP address and not search.domain.org .

What's the best way to fix this problem?

Info you might need: We cannot use .htaccess to mask it because port forwarding bypasses Apache and goes directly to Tomcat (which doesn't use .htaccess). Also, we have our D-Link router acting as a DHCP.

Any help you can provide would be greatly appreciated. Thanks,
pk

Last edited by laundry_day; 08-19-2007 at 06:15 AM.
 
Old 08-19-2007, 07:07 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i don't really understand the problem. normally the public ip is held on a firewall, not an internal device. as such if you try to reach that ip, or a domain name which relates to that IP, then from an internal LAN you'll hit the wrong side of a firewall, and be dropped or even get a webserver for configuration of that firewall... port forwarding only happens on the outside of a device like that, not the inside.
 
Old 08-19-2007, 10:00 AM   #3
laundry_day
LQ Newbie
 
Registered: May 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the quick reply. The search server is only for those on the outside. When they search, the address in their browser changes to be the static IP address and not the search.domain.org address we would like it to be. How can we mask the static ip address (without .htaccess)? Will we need to setup the server as a DNS? Hope not.

Any ideas.
 
Old 08-19-2007, 11:42 AM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
That sounds like a misconfiguration on apache. The DNS needs to be setup correctly already, or you wouldn't even be able to reach the search.domain.org server at all.

Check the contents of the directory /etc/apache2/sites-available. You should have a the site listed in there, and the first few lines should probably look like this:

Code:
NameVirtualHost 192.168.1.24:80 (whatever your local IP is on the server)
<VirtualHost search.domain.org:80>
        ServerAdmin postmaster@search.domain.org
        ServerName search.domain.org
Assuming you have virtual hosts enabled in apache2.conf, that should work fine, and it will show the domain name rather than IP in the url.

Peace,
JimBass
 
Old 08-19-2007, 11:57 AM   #5
laundry_day
LQ Newbie
 
Registered: May 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you for the suggestion.

Currently our DSL Router is setup to forward Port 80 requests (apache) to Port 8080 (tomcat), bypassing Apache. That's why the sub-domain is able to point to our Nutch/Tomcat homepage correctly.

I will try removing the port forwarding and make the changes you suggested and see what happens. Unfortunately it will have to wait until tomorrow.

I read somewhere that the webhost needs to create an "A record" with our Static IP address so that it's no longer a simple redirect, but an actual domain. Does that sound right?

Thanks again for the help,
pk
 
Old 08-19-2007, 12:14 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Oh, well if the router is forwarding to a different port, then apache isn't the issue. You can't remove that forwarding from the router, or the site wouldn't be accessible. Presumably, there is some config in tomcat that needs to be changed. I don't use Tomcat so I can't help directly, but I suggest posting the tomcat configuration, so people can look through it and see what needs to be changed.

The A record already exists. If it didn't, your site couldn't be reached at all. The DNS is fully set, you simply have some issue between domain names and IPs to iron out.

Peace,
Jim
 
Old 08-19-2007, 12:40 PM   #7
HowDoIProgramIt
Member
 
Registered: Nov 2006
Location: East Coast, USA (in "the great northeast")
Distribution: Custom / from source; Fedora, Debian, CentOS, Scientific; LFS.
Posts: 94

Rep: Reputation: 15
It sounds like you're always seeing the address from which the forwarded request is coming (eg. your own address), right? Are you ever seeing an address that's anything other than your own?

Quote:
Originally Posted by laundry_day View Post

...

I read somewhere that the webhost needs to create an "A record" with our Static IP address so that it's no longer a simple redirect, but an actual domain. Does that sound right?

...
I'm not quite sure what you're asking.

If there's no A record set up for your domain name, no one would be able to reach your site; whoever it is - it sounds like your hosting company - that's taking care of your DNS has to have one set up for you already...

Does the name "search.domain.org" currently have an A record defined for it, or does it exist only on your server?

If you're not sure, I would start by trying:
Code:
dig @nameserver search.domain.org A
where "nameserver" is the ip address or name of a nameserver, preferably other than your local one (you should be able to get the address from your router's config / status page if you need it).
 
Old 08-19-2007, 10:39 PM   #8
laundry_day
LQ Newbie
 
Registered: May 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Jim - Thanks. Tomcat has two files (probably more) that are used for config (server.xml and web.xml). I will look into those elements and post anything of relevance.

HowDoI - We only see the Static IP address we use (which the sub-domain forwarding uses too). I did a dig for the subdomain and Record A does not show our Static IP address. It lists all of Bluehosts information, with Record A set to a different IP (Bluehost?). Could that be one of the problems?

I apologize for my lack of knowledge on these issues and really do appreciate your patience. I know it seems trivial but we really do want to have our subdomain show-up so the connection from our main site to our schools server is transparent to visitors.

Thank you again.
 
Old 08-19-2007, 11:53 PM   #9
HowDoIProgramIt
Member
 
Registered: Nov 2006
Location: East Coast, USA (in "the great northeast")
Distribution: Custom / from source; Fedora, Debian, CentOS, Scientific; LFS.
Posts: 94

Rep: Reputation: 15
Quote:
Originally Posted by laundry_day View Post
HowDoI - We only see the Static IP address we use (which the sub-domain forwarding uses too). I did a dig for the subdomain and Record A does not show our Static IP address. It lists all of Bluehosts information, with Record A set to a different IP (Bluehost?). Could that be one of the problems?
That'd be my guess; it goes back to what you noted earlier with respect to someone suggesting you have an A record for search.domain.org (you don't otherwise have a DNS problem, or, as someone else - Jim, I think - noted, no one would be able to get to your site).

I would tend to think that the easiest way to deal with this would be to ask your hosting company to set up an A record for the address you're using for search.domain.org. If, for some reason, they're not willing to do that for you, the next thing I would do is check to see if the address they're using for the redirect is the same 100% of the time; if it is, there are a few different ways you should be able to make Tomcat think it's what you need it to be; personally, I'd try making an entry in /etc/hosts...

I'm not a Tomcat user; hopefully, one will comment on this at some point, as it may have a mechanism intrinsic to it for dealing with situations like this.

- Larry
 
Old 08-21-2007, 10:31 PM   #10
laundry_day
LQ Newbie
 
Registered: May 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Just wanted to give you all an update, in case anyone else has this problem in the future.

My webhost completed the "A Record" for the subdomain and now the Static IP address does not show up in the browser when people visit our Linux box. They only see search.domain.org .

Sorry to have bothered everyone and thanks for all the help.
-pk
 
Old 08-21-2007, 11:50 PM   #11
HowDoIProgramIt
Member
 
Registered: Nov 2006
Location: East Coast, USA (in "the great northeast")
Distribution: Custom / from source; Fedora, Debian, CentOS, Scientific; LFS.
Posts: 94

Rep: Reputation: 15
Quote:
Originally Posted by laundry_day View Post
Just wanted to give you all an update, in case anyone else has this problem in the future.

My webhost completed the "A Record" for the subdomain and now the Static IP address does not show up in the browser when people visit our Linux box. They only see search.domain.org .
Great, and congrats; I'm glad it's working for you!

As you were describing the problem before, I had a sort of "Sense of Deja Vu"; I've run into similar issues on more than one occasion. Fortunately, yours turned out to be relatively straightforward to fix and your hosting company wasn't a pain in the, uh, rear.

If you think about how everything interacts: DNS, httpd, etc. - it may seem like "just a search button", but there are, in fact, a lot of little things going on "behind the scenes". For what it's worth, I'd strongly encourage you to make sure you're comfortable with your understanding of how the whole thing works; assuming you're going to continue on developing your web site, you'll unquestionably encounter the same concepts, issues, etc. again. And, if there's anything you're not clear on, ask.

Quote:
Sorry to have bothered everyone and thanks for all the help.
-pk
No bother at all. I'm glad I was able to help, if even only a little. How does the old adage go, "the only foolish question is the one that goes unasked"? Something like that.


Take care,

Larry
 
  


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 setup domain via SSH File.am Linux - Newbie 1 06-06-2007 08:16 AM
About domain setup satimis Linux - Server 18 01-16-2007 08:53 PM
Setup BIND for Local Domain and hosting domain ALInux Linux - Networking 4 12-19-2006 02:26 AM
Domain and IP address setup satimis Linux - Server 6 11-25-2006 09:17 AM
Setup a Domain JROCK1980 Linux - Networking 3 03-04-2005 08:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:46 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