Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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?
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.
Location: East Coast, USA (in "the great northeast")
Distribution: Custom / from source; Fedora, Debian, CentOS, Scientific; LFS.
Posts: 94
Rep:
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
...
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).
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.
Location: East Coast, USA (in "the great northeast")
Distribution: Custom / from source; Fedora, Debian, CentOS, Scientific; LFS.
Posts: 94
Rep:
Quote:
Originally Posted by laundry_day
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.
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
Location: East Coast, USA (in "the great northeast")
Distribution: Custom / from source; Fedora, Debian, CentOS, Scientific; LFS.
Posts: 94
Rep:
Quote:
Originally Posted by laundry_day
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.