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.
Anyone know if this is possible. For example: 1 web server (runs hmtl sites) is configured on a home ISP i.p address on the default port.
Is it possible to run a totally different web server using that same i.p address but possibly configuring the website to load on a specific port under that same i.p so it doesen't direct people to the site on the first server? Can this be done? If so, how do you configure the specified port and was port can be used for the www.
The DNS entires will be the same.
I'm assuming you mean, for example, that one server (machine A) would be running on 192.168.1.5:80, while an entirely different machine (B) would be serving up another webpage at 192.168.1.5:81. That should be possible using port forwarding. What would happen is that Machine A would automatically route any requests for data on port 81 over to Machine B. Or you could set up some other arbitrary way of doing this.
Here's a site that discusses doing this using iptables:
yes you got the right idea. It looks like the ip tables is what I was looking for.
I can re-summarize what I want.
Lets say my cable modem gives me an ip of 66.66.66.66 and I have a mini network and router setup. The main pc with the modem attached to it is running 192.168.0.1. The first webserver is running off of that. So the 66.66.66.66 ip is resolving to www.firstwebserver.com. So the first web server resided off of the cable modem i.p.
I have another machine on the same LAN and I want to run another web server off it. So I obviosuly need to use that same 66.66.66.66 i.p but when someone accesses my website, I want it to re-direct to my site instead of the default server I have setup.
So I suppose setting up the i.p tables and forwarding will do the trick. I thought I maybe had to specify a port, so when someone types the the domain name of the site I want to build on the second server, it can redirect to my site instead of the default port which is running off the first server
I hope this is not confusing. I have a lot more research to do it, it may sound a bit noobish (if thats even a word)
If you don't want to use different ports, I'd have though that apache (for instance) would be able to simple redirect a name based virtual host and/or redirects
Lets say my cable modem gives me an ip of
66.66.66.66/www.firstwebserver.com -->192.168.0.1. (first web server)
I have another machine on the same LAN and I want to run another web server off it. So I obviosuly need to use that same 66.66.66.66 i.p but when someone accesses my website, I want it to re-direct to my site instead of the default server I have setup.
I hope this is not confusing. I have a lot more research to do it, it may sound a bit noobish (if thats even a word)
Whenever someone will browse www.firstwebserver.com, it will automatically open 192.168.0.1:80 ( so we got to do nothing for tht)
For another webserver (hosted at suppose 192.168.0.2:80)
We got to run..
So I suppose setting up the i.p tables and forwarding will do the trick. I thought I maybe had to specify a port, so when someone types the the domain name of the site I want to build on the second server, it can redirect to my site instead of the default port which is running off the first server
I dont find any need of two domain names.. but if still you need them then probably you got to specify a different port like 81 or some else to catch these packets n forward over to another webserver.E.g. www.secondwebserver.com:81, as this will by default comes to your 66.66.66.66 only.
___________________
With best regards,
Amit..
--
Quote:
Originally Posted by Albert einstein
Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.
As billymayday said, you must remember that www runs off urls, which are names.
You can add ports after the names, but getting someone to type it every time is not very reliable.
You have a domain name, eg mycompany.com and you can choose the third/fourth level names off that yourself, eg site1.mycompany.com site2.mycompany.com,
then make the default webserver redirect to the correct webserver.
thanks a lot guys, you all understand exactly what im doing. I'm only doing this b/c my bro is running his own servers right off the router (192.168.0.1) so I don't want to touch any of his stuff and would rather run my own servers.
I have one quick question which I probably already know the answer of b/c you guys pretty much told me so. Is it possible at all for someone to type my site, like www.mywebserver.com and have it automatically configured to redirect off the 81 port instead of 80 without them typing the actual port #? It then obviously must hit my site, for eg 192.168.0.2.
That's done in httpd.conf in the first line of the VirtualHost stanza..
eg
Listen 81
NameVirtualHost *
<VirtualHost *:81>
Just remember that whatever you have to type for a url, including port numbers, is part of the virtualhost definition.
If you have :81 in the url, the server must listen on port 81
and the VirtualHost definition must include it too. www.domain.com will go to port 80
That's done in httpd.conf in the first line of the VirtualHost stanza..
eg
Listen 81
NameVirtualHost *
<VirtualHost *:81>
Just remember that whatever you have to type for a url, including port numbers, is part of the virtualhost definition.
If you have :81 in the url, the server must listen on port 81
and the VirtualHost definition must include it too. www.domain.com will go to port 80
Peter i am not talking about any virtual hosting & nor about a different port.
I am taking the case that i have registered a domain name with MY ISP or any other ISP, e.g. www.xyz.com, & now i want whenever my clients go & browse www.xyz.com[without any ports specified], they should come to my static ip but not at 80, at other port 81, is that possible ?
Can my/any ISP do that ? (if yes)
But will that be done at DNS server level, i think NO.
No such luck..
There's nothing apart from dyndns.org that might even offer the possibility of forwarding to a different port..
Getting to a different server is what the www part of the domain name is for.
www is only one possible name for your webserver, it's just the most common name.
xyz.com is registered, www.xyz.com is your choice, so is www2.xyz.com
You make these changes yourself on your dns server, then the first webserver does a redirect to the correct one.
You could set up a proxy for incoming connections to do this if you don't want to play around with the first server's programming setup.. But apache does this very well too..
No such luck..
There's nothing apart from dyndns.org that might even offer the possibility of forwarding to a different port..
Yes, they do.
(I've just gone through dyndns.com)
@ddzc (orginal query poster)
I am not sure about every DNS service provider but yes with dyndns.com(this is the case if your clients sit outside your LAN or on internet), you can make a domain name to redirect over to your existing 66.66.66.66:<any-port> & further redirecting it onto any LAN ip<any-port> web server. Or even you can get a new domain-name to redirect over to your existing domain-name:<different-port>.
Detailed information regarding dyndns.com http://www.dyndns.com/support/kb/arc..._requests.html
For other DNS providers, i suggest that you should ask your ISP/DNS provider for domain name to a different port redirection.
The above solution fits best if in case your clients are accessing you through internet. Otherwise a locally hosted DNS server can easily solve this out.
__________________
With best regards,
Amit..
--
Quote:
Originally Posted by Albert einstein
Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.