Can rocket.chat be server on 2 interfaces at the same time? - dns

here is the situation,
we have a domain, let's say example.com
I have added a subdomain to the dns, chat.example.com
I have modified the Caddyfile inserting http://chat.example.com (it works fine)
However, rocket.chat is hosted on our local server, and it is behind the router provided by our ISP, which apparently is programmed to return its own home page if an address is typed that resolves to its external ip address. In other words, if a computer located inside our local network types http://chat.example.com, it gets the router home page (the one where you can configure it).
I have solved it by modifying the hosts file, but I would prefer a cleaner solution. Is there anything that I can do on the Caddyfile, perhaps allow him to reply on 2 interfaces (http://chat.example.com and http://192.168.1.x), or something else that I have not thought yet?
Thank you!

Related

Redirect TLD (dev) to local IIS

In the office, we have already setup a redirect in the DNS to push .dev back to the localhost. The issue is when I am not in the office this does not work. I edited my host file for the websites but as I add more in the future I would prefer to not have to edit my host file.
Is there a way, within my computer, that I can force the TLD of .dev to always go back to my localhost?
I realize I may have to find a way to do this on my router so that the DNS is resolved.
Example:
- Local IIS
-- Website A (with a Host Name Binding of website-a.dev)
-- Website B (with a Host Name Binding of website-b.dev)
When I open a browser on my local box and type in website-a.dev, it should loop back to my local IIS and pull this website. Same thing for website-b.dev, of course, going to the other website. Now I know if at work we have setup the DNS to allow for this but I want to know if this can be done at home, where I do not have direct access to the DNS.
I know I can just put into my host file
127.0.0.1 website-a.dev
But I want a catch all for .Dev to go back to 127.0.0.1
Take a look at:
https://superuser.com/questions/135595/using-wildcards-in-names-in-windows-hosts-file
It explains that using Acrylic allows you to use wildcards and acts just like your host file.

Using GoDaddy domain with No-Ip

I have a GoDaddy domain www.exmaple.com which points to 255.255.255.255 (fake IP of course). My web server is behind a router that forwards port 80 to the appropriate port. All fine and dandy. However, like 99% of people out there, I have a dynamic IP. So I set up a hostname with noip.com called helloworld.ddns.net, set up their update client on my server (so it can update them whenever the IP changes (hasn't happened yet but i'm hoping it works as advertised), and then went to godaddy.com to change my records. Which is where stuff gets as hairy as harambe.
I started off by removing my A record, and changing my CNAME to point to helloworld.ddns.net.
Didn't work.
Googled around, and found that I need/should use the noip NSs. So I went back to godaddy, and changed my nameservers from theirs to the noip ones... ns[1,2,3,4,5].no-ip.com.
Still doesn't work. Should also point out, that after I made this change I lost the ability to set any records on my domain name. Which I guess makes sense since there's no point in godaddy having a record if I'm not using their NSs.
Tl;dr: How do I point godaddy domain, www.example.com, to a noip hostname, helloworld.ddns.net, which in turn points to my dynamic home ip, x.x.x.x.
Finally managed to solve my own issue, and I feel very silly for not realizing what the issue was before. The problem was that the CNAME was pointing to a subdomain (www) and therefore one couldn't access the site without including this in the URL. Summarised solution:
GoDaddy now has CNAME with a specific host name (ex www) and the noip domain as the value
No A record
Kept the default GoDaddy NSs
Configured forwarding w/o masking, to www.example.com... therefore, when someone tries to access example.com, they are automatically forwarded to the www subdomain.
A little bit of patience for propagation and everything was up and running.

Put a subfolder onto a different server with CNAME

Here's the situation. Website.com is an ASP site which needs a blog that is to be Wordpress. So the website.com/blog needs to be hosted onto a php-friendly server. The company hosting the ASP site doesn't want to have anything to do with Wordpress so we have to use some of the shared hosting providers.
How do I have the Blog section placed onto an entirely different server? I've heard this is done with CNAME, but I've never used it. Most of the research I've done revolves around subdomains, but I need a subfolder mapping, and there's not much to read about putting subfolders onto different servers with a different IP and everything.
Thanks.
There are a few different options:
you can bring the traffic to your own server and then redirect to
the correct location
you can bring the traffic to your own server and then proxy it to the correct location
you can direct the traffic to the correct location either via full page or an IFRAME type mechanism
Each option has some benefits and drawbacks depending your devs knowledge level and your infrastructure. Regarding subdomains, you could use a combination approach where you, for example, use subdomain.yourdomain.com to point to a server instance (can be the same server or a totally different one) that maps the subdomain.yourdomain.com name to a specific path, usually via Host header.
A CNAME is a function in DNS that says "Whatever thing you wanted to find for this name, use the same thing for that other name instead". When you're working with web stuff the "thing" in there is nearly always an IP address.
That is, what a CNAME can do for you is to say that when a user's web browser tries to look up the IP address for website.com, it will use the IP address for someotherwebsite.com. Note the total absence of anything web-related, like subfolders, in this. CNAMEs work on whole domain names, nothing else. Since you want to serve only a part of the stuff at a particular name from another server, CNAME cannot help you. CNAME is the wrong tool for you problem. Do not taunt happy fun CNAME.
In order to serve website.com/blog from another server than website.com, you pretty much have to do some sort of reverse proxying (where the ASP site's server relays requests between the user and the Wordpress server). It's probably easier and more robust to give the Wordpress site its own name (blog.website.com or something), and redirect to that from website.com/blog, but only you can know if that's politically possible in your case.

One domain (www.example.com) different paths (/ vs. /server2) go to different servers?

I'm wondering if it's possible to host an application on one server (S1) with the root directory of a domain (example.com/) as its approot, but have a TOTALLY DIFFERENT application on another server (S2) with its approot pointing to a specific path of the same domain (example.com/server2).
I'm not talking about subdomains; I'm not talking about load-balancing one application. I'm talking about example.com/* pages on S1, and example.com/server2/* pages on S2. Anyone have any ideas? Thanks!
I'm not familiar with the term "approot", but suspect it is the name of some configuration at the webserver end. It's better to think about these kinds of question from the other end: how will a message get from the browser to the right server. The user gives the browser a URL; the hostname in the URL is looked up in DNS to find an IP address; an HTTP request is sent to that IP address, with the requested path in it.
So ultimately, you have to have some server (or set of interchangeable servers) serving the whole of example.com, because that's the only part that will be looked up in DNS.
That server could, however, be a proxy, which looks at each request it receives, and passes it on to another server based on some configured rules.

Make original site url name to some fake url name

I am new to rewrite site url name. I have a site url like http://66.15.101.250/test/ . this is my owned server link So i want to change this site url to something other name like http://testsite/test/ ( i do not want to give domain name to this ip address url).And i have otheres site running on this http://66.15.101.250/test/ server . I have no idea how to do this, what should i do.
Is this possible through .htaccess file or something else
Thanks in advance
Your server can only respond to requests it receives, and will only receive requests routed to it by DNS, so if you don't own the domain name, you can't receive public traffic directed towards it. You could silently redirect users from
http://66.15.101.250/test/ to the content found at http://testsite/test/ but they would still see the http://66.15.101.250/test/ url in their browser.
If you think about it, its a good thing you can't do this or I could make stealyourcreditcardinfo.com appear as paypal.com. Indeed most uses for what you are asking about would not be legitimate ones...
For your own internal testing purposes, you can make virtual host entry for testsite.com and your server will respond to any requests it receives for testsite.com. You then change your HOSTS file to point testsite.com to 127.0.0.1 and testsite.com will work in your browser, but only on your machine because you manually overrode your own DNS. The DNS everyone else is using is still pointing testsite.com to the actual IP address somewhere else
If you need this for testing purposes (as it seems to me), you can put 66.15.101.250 testsite in your hosts file and configure a virtual host for testsite in your webserver.

Resources