Browsing sites with their domain name from the same server they are hosted on - iis-6

I have a co-located webserver(Win2k8) having a public IP and have hosted my ASP.NET website on the IIS. Though, I am able to browse everything else from the local browser(IE) installed on the server, the server somehow fails to browse the websites that are hosted in its own IIS when I access them using their 'domain name' set as a host header. For e.g: If the website is for "www.mywebsite.com", so naturally I have set the Host header property to "www.mywebsite.com" and when I put "www.mywebsite.com" in my IE address bar it fails to get the request.
Ok, so now why I need to access this website is that, I plan to send a Query parameter to one of the pages from another page of the same website.
Any idea how to get this working? Thanks in advance folks.

It may be trying to reach itself via its public IP address, which it may not be able to route to.
You can try adding a line into your hosts file (C:\Windows\System32\Drivers\Etc\Hosts, or equivalent) as follows:
127.0.0.1 www.mywebsite.com
Which will force it to access it via the loopback adapter.

Related

can i use my device name and IIS host number instead of IPv4 and IIS host number for api calls?

Currently I am using my ip and IIS host number for api calls.
For example, I use [https://192.168.1.27:100/api/values ]
where 192.168.1.27 is my ip and :100 is the host number in IIS
Now, instead of my ip "192.168.1.27" , I want to use my device name which is "DEVELOPER-1". Is that possible? If yes, how may i do that?
In the IIS manager, right-click on a website, and then click Edit Bindings.
In the Site Bindings window, click Add.
In the Add Site Binding window, enter the hostname as "DEVELOPER-1".
Now, if you want to use "https://DEVELOPER-1:100" instead of the "https://192.168.1.27:100". For this, you have to open the hosts file located in the C:\Windows\System32\drivers\etc, Add "192.168.1.27 DEVELOPER-1" at the end of the file. This will tell IIS to search for the website when https://DEVELOPER-1 url is entered.

How can i create my own custom URL for my website i'm hosting

I have set up an apache server on my computer and I am hosting a website off of it. My url that is accessible via other computers on the network is my ip followed by the file path. For example 192.1.1.1/blog/index
I would like to be able to have users access my website by typing studioblog.com or just http://studioblog. How could i achieve this?
I have tried editing the localhost via /etc/hosts file but to no avail

SQL Reporting services external NAT

I have a Reporting services URL accessible internally on a Server. I want to expose this to a user who is not on the same network - but can access the network via a firewall.... the RS instance is thus setup with SSL etc.
The server is already running one SSL site - so we have used a different port number.. eg. 446 for the RS site.
So internally the URL is as :
http://server:446/Reports_Test and this works as expected.
Externally we NAT 443 on a specific name to 446 intenally
So externally I ask for (via https)
reporting.example.com/Reports_Test
I get the login prompt as expected... but then once successful... the site redirects to (via HTTPS)
reporting.example.com:446/Reports_Test
Is there a way to stop the RS changing the port number ?
Use the Reporting Services Configuration tool to configure the URLs.
To set advanced properties on a URL:
On either the Web Service URL or Web Portal URL page, click Advanced.
Click Add.
Click IP Address or Host Header Name. If you specify a host header, be sure to specify a name that the DNS service can resolve. If you are specifying publicly available domain name, include the whole URL, including http://www.
Specify the port. If you specify a custom port, the URL to the application must always include the port number.
Click OK.
Test the URL by opening a browser window and entering the URL.
From:
https://msdn.microsoft.com/en-us/library/bb630447.aspx

Can't access my website after trying to move it to another server

I want to move my website to my new virtual server that I bought from another service provider.
I installed Apache Webserver, created a virtuzal host for the website and I changed the DNS in my actual service provider's admin panel pointing to the new server's IP address.
I then realized that I can't access mysql to export my database and I disabled the domain on the new server, changed the DNS back in my old admin, but now I get a ERR_CONNECTION_REFUSED when I try to call the website.
I don't find anything on Google, because everybody wants me to delete browser cookies (which I did), but that doesn't help.
What can I do for getting back the old website and being able to export my MySQL database?
It may well be that your DNS records are still propagating and you need to wait. Try adding an entry in your hosts file to point to the "old" site URL and hit it in your browser. If it works then it's the DNS not completed propagating. Otherwise your error looks like an Apache issue not a MySQL issue.
I simply deleted the virtual host on the new server for the domain and I was able to access the "old" site immediately.
It's still possible, that the DNS just finished propagating, like #George said, but it's very unlikely.

IIS 6 - Create a virtual directory that points to an IIS application on a different server?

Here's the scenario:
Server A is hosting the 'main' application (www.example.com)
Server B is hosting a support application (b.example.com)
They are connected internally to each other through a 192.* address and are both externally available through DNS
Server A has several virtual directories that are mapped through UNC shares:
www.example.com/virtual1 -> \192.168.1.1\virtual1 (on serverB)
I'd like to be able to run the application that sits on Server B (served through IIS) and make it appear as if it's running on serverA:
www.example.com/application -> b.example.com/app
I'd still want to be able to access server B directly
b.example.com/app
Any ideas?
Edit:
Turns out the application behind the proxy refused to let me dynamically change it's form "action" (nor did it let me change anything else). I was able to display the data from the server; just couldn't post :(
So both answers pointed me in the right direction. I used a proxy:
http://code.google.com/p/iisproxy/
I created a virtual directory on Server A that matched the directories I needed on Server B - and it worked! :-)
This should be possible in IIS. I remember I had to do this once.
Just create a virtual directory using the UNC path pointing to \\ServerB\SharedAppDirOnB and (if necessary) "Connect As..." using the credentials needed for Server B.
If you have problems with "Connect As..." it could be a folder permissions problem of Server B. Try the following thing: add a new user account on your main server which has the same name and password as the account on Server B. It sounds stupid, but I remember it solved my issue. You could for example add a new user account on both servers: "IisCommon" with the same passwords on both servers. Then make sure you give all necessary file access permission to the folder on server B (and the Share permission!). Try first connecting manually using Windows Explorer if you can access the share.
Make sure that you mark the new virtual directory as application and give the right execution permissions.
Another solution would be some kind of reverse proxy. I used a third-party product on IIS 6.0 for this: ISAPIrewrite for IIS. The "proxy" mode allows you to "forward" request made to your main server (www.example.com/...) to your other server, but serving the resulting responses as if they were processed by your main "domain" application. The feature is called "proxy directive". It accepts regular expressions.
Since serving the virtual directory from server A through a UNC share apparently does not work, you need to serve b.example.com/app from server b.
DNS resolves domain names to IP addresses. You are asking for the same domain name to resolve to two different IP addresses, based on a different URL. This is not something that IIS or Windows can do.
Your options are:
write a proxy service on server A that passes requests on to server B. If you want it completely transparent (not just a redirect), you'd have to stream back the response as well. This is not trivial, but possible.
Put the server B page into an IFRAME on a new page on server A.
Use a load balancer in front of both servers that can split traffic based on URL