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

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

Related

Website not accessible externally following PHP upgrade

Bit of a strange one - Over the weekend I updated the version of PHP on one of our servers and all seemed to be working fine, however yesterday, we started to receive complaints that the site was down.
After looking in to it, the site works fine when connecting from the internal network, but it times out when trying to connect from an external IP address.
Server admin isn't really my strong suit, so not really sure where to begin. I've checked the httpd.conf files and all looks fine, the apache config test reutrns 'OK' so at a loss as to where to go next.
Server is running Centos, PHP 7.2 and apache 2.4.6.
How can I get the server to respond to external requests?
Andy
You can use this tools (metod) to check where is propably the problem:
I. on serwer, check :
whether is serwer conections to internet - ping, tracerout
whether page is loading (on local) - lynks, links (text web broweser)
whether your dns is working (or dns ISP prowider) - depending on the service used, e.g. BIND (check usage this tool in internet)
whether your firewall is ok configured and good work - depending on the service used e.g. iptables
whether domen settings is ok,
...
II. on computer, check: (in internet, not in local network with your serwer)
whether the website loads in the browser eg firefox after using ip address (your server where the page is located) in www bar
whether host in internet have a contact with your serwer - ping, tracerout
whether the website loads in the browser eg firefox after using ip address (your server where the page is located) in www bar
...
The problem is wery complicadet becouse I dont now what exactly you have an infrastructure and it is settings (network, ISP, etc.) which you on host the page you are writing about. For this reason, it is difficult for you to precisely help.

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.

Switching Cpanel site from using Domain to IP?

I am switching our site from one server to another, but need to test its all working without changing the domain, how can I change it so it accepts connections to the IP?
You have tagged Cpanel so if it is Cpanel/WHM,it includes facility of temp URL which generally goes like http://IPaddress/~cpanelusername
This should load the webcontents of your "publichtml" of Cpanel account.
Please specify the details of your controlpanel on both servers if you are not referring to Cpanel-WHM.
I think you are trying to check your site from new server without changing domain nameserver.
To check our domain from new server, You need to update your local PC host file ( C:\Windows\System32\drivers\etc\hosts ) with new IP and your domain so that you can test your domain from new server.

Server Alias in IIS

I would like to create the equivalent of Apache Server Alias entries in IIS 7.5. Anyone know how to do this?
If I understand Apache's Server Aliases correctly, then what you're looking for is a Virtual Directory. In IIS manager, right-click a website or folder and select "Add Virtual Directory." You can then add a directory to the website with a specific alias (which will form part of the Url) and physical path (which can be anywhere on disk, not necessarily under the root folder of the website).
EDIT: suspecting that I've confused Apache's "alias" and "server alias" functions: you may be looking for an IIS site's "Bindings", which allow multiple domain names to be mapped to specific web applications.

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

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.