Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Background
I'm using a single server in my home network that runs Windows SBS 2011. It services Active Directory, IIS7 and DNS services.
Currently I can change how my domain (mydomain.com) looks on the Internet using the "Default Web Site" website. However when I create additional websites (blog.mydomain.com) in IIS Manager, they are not showing up on the Internet.
Question 1: Is it possible to set up two subdomains with 1 IP address in Windows IIS7?
Can I make it so www.mydomain.com and blog.mydomain.com are both public on the Internet?
Question 2: How do I go about setting up the subdomain blog.mydomain.com?
In IIS Manager, I'm using Sites > Default Web Site for www.mydomain.com files. This is working for me and I can create and set up index.html and build the website.
For the subdomain, after I add a website, what settings do I need to change:
- What settings do I need to have for the website
- What records do I need on the server DNS
- What records do I need on the domain DNS
- What other settings do I need to change?
Yes, this can be accomplished.
You use the "Bindings..." option In IIS7 for configuring the domain/subdomain for each website.
This is a way you could set it up:
Make sure you have two websites in IIS7. One is set to the root of your website directory, another one set to the root directory of your blog platform.
Your website has the binding configured like this:
www.mydomain.com using Port 80
The blog site has the binding configured like this:
blog.mydomain.com using Port 80
Q1: yes
Q2: Create two websites, ignore the default web site. One for www and the other for blog. On the new website screen specify the Host Name accordingly, i.e. www.mydomain.com for the first site and blog.mydomain.com for the second. Keep the port 80 for both. Later you can change these settings in the website Bindings screen.
What this basically does it associates names with different websites so when requests come to your server on the same IP IIS knows to which website to dispatch the request.
The default website in IIS, because it has no Host Name, will handle all the requests that are neither for www or blog subdomains.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
This might be a very basic question but I've been stucked for 2 days
I've bought the domain name AAA.xyz on Namecheap and I have my Golang web server running on my port :8095 (I've redirected my ports on my router so my server is accessible from everywhere with my public IP http://93.6.XXX.YYY:8095/)
How do I make my Namecheap domain name point to my IP adress with the right port so when I enter AAA.xyz on my browser I get response from my API ?
You have to edit your namecheap DNS settings to add an A Record, which will point to your server IP. That's enough to divert all traffic to your domain, to your server.
Although, unless it's not a production setup, it'd be better to let a reverse proxy server like nginx handle the incoming http traffic. Then you won't have to expose your port to the outside world either. (Unless you want to).
Install nginx. Add a proxy pass to your nginx config file which will route all requests coming to port 8095 to your application at 127.0.0.1:8095.
This will also help you when you have multiple go apps running on your server on different ports. You can use different URLs to point to different apps.
e.g. https://yourdomain.com/app1 will go to 127.0.0.1:8095
and https://yourdomain.com/app2 will go to 127.0.0.1:8096
Bonus: You can use Letsencrypt to provide your nginx server with an HTTPS certificate for free and then all communication with your applications will be happening through port 443 on HTTPS, without configuring every app to handle the certificate.
Also, open ports 80 and 443 in your firewall.
If you need any help with a specific step. I'll expand on that.
This question already has answers here:
Access XAMPP Localhost from Internet
(4 answers)
Closed 7 years ago.
I am working on web developing since a long time but using web hosting providors like godaddy, hostgator etc. Now i want to host website from my own computer. I have configured xampp server on my pc but its only for my computer. i want to take it to internet. any idea??????
One more thing is that i have configured my domain name in hosts file and i want to host website on that domain name online so that any one can open my website!
First you need to get a Public static IP which must be accessible from outer network. Then You need by a domain name. Then map the Ip to domain name. Once this mapping established, when ever some body try to access the URL(domain), first DNS will be resolved to IP:port then the request will redirect to the IP:port i.e your computer. Once compute is found, using port your web server will be traced which will eventually response to the user request.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I've set up a application on Heroku and have also purchased a domain from GoDaddy.
I searched on Google how to connect my domain to Heroku and I also read the Heroku documentation but I am not able to connect it with my domain.
I am a beginner and have found I need to add cname or domain may be but I don't know how to do it. How can I connect my domain with the heroku app? I need to add DNS on my domain but how to add it?
Please let me know very very basic and detail step by step procedure to connect my domain with the Heroku app please.
Heroku provides detailed instructions in the Custom Domains support page.
Possible duplicate.. As per the user request we do ...
There are 2 steps you need to perform,
Add the custom domains addon and add the domain your going to use, eg www.mywebsite.com to your application, Running below command to perform this task
heroku domains:add www.example.com
Go to your domain registrar control panel and set www.mywebsite.com to be a CNAME entry to yourapp.herokuapp.com assuming you are using the CEDAR stack.
just put www in value and target is your heroku app like yourname.herokuapp.com
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have a Heroku app and I've add a CNAME (www to herokuapp) to redirect it from GoDaddy to Heroku. Now I'm trying to manage also the naked domain.
This is from Heroku documentation.
Naked domains (also known as bare domains or apex domains, for example mydomain.com) must use DNS A-records. To setup your root domain, add separate A records for each of the following addresses using your DNS management tool:
75.101.163.44
75.101.145.87
174.129.212.2
Check that your DNS is configured correctly with the “host” command:
$ host example.com
example.com has address 75.101.163.44
example.com has address 75.101.145.87
example.com has address 174.129.212.2
I've also activated the forwarding from the GoDaddy main menu.
Ok, if I try host example.com with my domain, all is ok.
But, when I try with the browser, I get this:
Heroku | No such app There is no app configured at that hostname.
Perhaps the app owner has renamed it, or you mistyped the URL
I tried also with the command heroku domains:add yourdomain.com
but this create a second instance of my app, it doesn't redirect it to the full domain www
Heroku highly advises against using A-records to point domains at cloud apps. Using A-records increases the chance of instability for DNS resolution. Heroku goes into details here.
Instead, you should redirect your naked domain to the 'www' subdomain. You can refer to this SO thread for more details on how to set that up on GoDaddy.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I know how to set up a local webserver using xampp on windows... I enter my alias and target on the hosts file (c:\windows\system32\drivers\etc\hosts) and then add a respective entry on my apache vhosts config file. This way, assuming that my webserver is listening to port 80, I can for example map example.com to my local webserver.
I've always entered the whole domain name (that is e.g. example.com) in my hosts file and any requests on that name would be directed to localhost.
Now I was wondering if there's a way to only forward example.com on a certain port (for example only example.com:8080) to the local webserver, and leave example.com (on the default port 80) alone, so that it would still go to my live production website.
As far as I understand this might not be possible using only the hosts file (I tried adding the port :8080 to my domain names - didn't seem work ;-) )...
I really don't know much on this topic so any ideas, insights, links, reading material, tools are welcome.
Edit:
Arnout's reply answers the question I've asked above but doesn't solve my actual problem. Rerouting example.com:8080 to localhost:80 does work and if I access example.com it loads up the frontpage of my local version, but all links on that page of course don't know about the port number and therefore point to the production version... The actual solution to my problem seems to be to bite into the sour apple and fix my application (following Rob's suggestion) and remove all hardcoded urls, so that it works on any domain...
Internet Junkbuster (a proxy server) can do this using its forwarding functionality.
Just add a line like
example.com:8080 localhost:80 . .
to sforward.ini, and uncomment the forwardfile line in junkbstr.ini. Now configure your browser to use a proxyserver running at port 8000 of localhost, and you're set.
I'm sure other proxy servers have a similar feature — I just like Junkbuster since it's a simple standalone executable.
You are playing in the area of domain name services (DNS). Technically, with an advanced DNS configuration (which can include remapping ports), what you propose is possible and it is done routinely on the Internet. However, it is unlikely that you would want to go to that much trouble and expense locally.
On the other hand, I suspect that your real issue can be addressed more easily. Why would you want to have "example.com" resolve to your local web server? You can already reference your local web server as "localhost", as "127.0.0.1", and via its assigned machine name "workstation-x".
The only reason that I can think of, and that I have seen, for wanting to reference your local web server with the same host name as your production web server is due to hard-coding the server host name into your links within your application's web pages. If that is the case here, the answer is simple: don't! You should ALWAYS implement your web applications so that they reference everything (other pages, CSS, JS, images, etc.) relative to the deployed server. If you deploy across multiple servers, then your references must be absolute based on configurable server host names. This is easy to do, and there is no reason not to do it.
If this is not the case, then please explain what you are trying to achieve and what motivates you to try.
EDIT: Since you have confirmed my guess that the problem is hard-coded references to the production host name in the web pages, let me simply add that I have ALWAYS, WITHOUT EXCEPTION, found that it is cheaper to fix the real problem than to accumulate workarounds (such as your attempt to remap ports). I have never encountered an author who has argued the opposite.
Fixing the pages should be little harder than a global search & replace, especially with a decent text editor. Even writing a simple script to change the source files would be vastly cheaper and easier than your attempts at a workaround.
Regardless, best wishes to you, and let us know how it turned out.
Can you confirm if 8080 port is listening on webserver? use the command "netstat -na" to see if the port 8080 is listening.
Did you add 8080 port on apache config file as the same as the default 80 port?
Once you add port 8080 on apache config file to make it listen and double check if 8080 port is listening on webserver, then you will be able to access the page using port 8080. like http://mytestwebserver:8080/index.html or something like this....