I have created a two sites like this:
<Sites>
<Site name="WebRole" physicalDirectory="./WebRole">
<Bindings>
<Binding name="Endpoint1" endpointName="HttpEndpoint" />
</Bindings>
</Site>
<Site name="MySite" physicalDirectory="./MySite">
<Bindings>
<Binding name="Endpoint" endpointName="HttpEndpoint" hostHeader="www.MySite.com"/>
</Bindings>
</Site>
</Sites>
I have changed my DNS under CNAME (Alias) -> www to xxx.cloudapp.net
Therefore when I type in www.MySite.com it gets to my cloud app, the hostHeader is recognized and goes to the right physical site. The HostHeader works fine.
Now I try to do the same thing as a subdomain.
<Site name="MySite" physicalDirectory="./MySite">
<Bindings>
<Binding name="Endpoint" endpointName="HttpEndpoint" hostHeader="sub.MySite.com"/>
</Bindings>
</Site>
In DNS manager I didn't try to do it in CNAME but instead I did a masked Forward of the sub domain to the same side's address xxx.cloudapp.net.
But this doesn't work. It simply open up the first Site instead. It seems the HostHeader is not understood in order to point to the second physical path.
What am I missing?
As far as I can tell "masked forwarding" usually works by using frames, and if that's the case the host header information won't be forwarded to Azure.
Your DNS host will create a Web site with a frame, and the data for that frame will come from the xxx.cloudapp.net site. As there's no host header information forwarded the Azure load balancer won't be able to use the alternate site.
I'm afraid it looks like you'll need to use the CNAME system to explicitly forward the host names.
Related
I have opencms 10.5.4, tomcat 8.5.37.
I have a site "localhost:8080", now i have to move the site to "localhost:8080/mydirectory"
I tried to change opencms-system.xml
<sites>
<workplace-server>http://localhost:8080/mydirectory</workplace-server>
<default-uri>/sites/default/</default-uri>
<shared-folder>/shared/</shared-folder>
<site server="http://localhost:8080" uri="/sites/default/" title="Demo Site" position="3.4028235E38" webserver="true">
<parameters>
<param name="locale.main">it</param>
<param name="locale.secondary">en</param>
</parameters>
</site>
</sites>
I restarted catalina but nothing happens.
What is the best way to change domain url without breaking the links of the css and files that are in the modules?
I am not sure what you want to achieve. If you just want to access your website through an additional folder to let's say distinguish from other sites you could just create a folder within the OpenCms workplace and move all your content to that folder.
Create the folder in the root directory of your site (e. g. /sites/default/mydirectory/).
Changes to opencms-system.xml are not necessary for this. So please remove mydirectoryfrom your workplace-server configuration.
HTH
Best regards
Kai
ASP NET MVC5 web application, Visual Studio 2015, IIS 10
Along the development I had to implement SSL. I just cannot say why, maybe Conveyor by Keyoti, maybe Elmah, maybe a local smtp server.. something required it. It's not really that important.
Having to test the application upon deployment on a remote server I have now to remove the https stuff. So I click on my project, then F4 to open the property window. Set SSL Enabled = False, check applicationhost.config.
<site name="xyz" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\NucLuke\Documents\Visual Studio 2015\test\xyz\xyz/>
</application>
<bindings>
<binding protocol="http" bindingInformation="*:51003:localhost" />
</bindings>
</site>
Everything looks just fine. So I close VS, start it again, run website getting no errors but
Unable to connect
IIS Express running application panel shows everything is fine:
How can I trace what's going on?
If the problem was on website I should be able to track it at debugging, but that doesn't seem the case. Is there a way to trace IIS Express?
Something was forcing the application to switch to SSL and I could not remember WHAT. My bad, but I suppose that is not so uncommon when you work for quite a long time on development implementing several extension.
In my particular case implementing Google login required SSL to be turned ON and a
[RequireHttps]
attribute in HomeController. This attribute was accountable for forcing IIS to modify config files in order to serve the home page as https. Hope this can help someone else not to lose one day looking for such a silly error.
External clients are hitting my Azure website with urls that contain the colon (:) character. The request are not valid, but on my old IIS server it would give a 404 error. On Azure, the same URL will give a 500 error. This wastes my time, as I have to check the logs. This is an example of a request:
http://www.example.com/http:/www.example.com
Is there any way of avoiding this behaviour on the server side, and give 4xx error instead? Keep in mind, this problem is on Azure only, and I do not control the requests.
If you are running a .NET application, then this is caused by ASP.NET HTTP runtime, more specifically by its request filtering feature.
If the URL path contains any of the disallowed characters (<,>,*,%,&,:,\\,?), the runtime throws the exception and because of the exception the IIS returns error code 500.
System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (:).
You can configure disallowed characters in your web.config file.
<system.web>
<httpRuntime targetFramework="4.5" requestPathInvalidCharacters="*,%" />
</system.web>
But i would be careful, because there might be some security implications of such change.
Using the KUDU Console in Azure add the file applicationhost.xdt to D:\home\site.
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document- Transform">
<system.applicationHost>
<sites>
<site name="%XDT_SITENAME%" xdt:Locator="Match(name)">
<virtualDirectoryDefaults xdt:Transform="Insert" allowSubDirConfig="false" />
</site>
</sites>
This does the job, but has an unfortunate side effect, in that any web.config in any application subdirectory was ignored. For our side, this had the effect of not loading any static files which meant the site did not work properly.
This will work fine for any site having a single web.config at root level.
I want to import virtual directory setting via file in IIS 8.5, but cannot find an option to do so. In IIS 6 you can:
Right click on the site -> New -> Virtual Directory (From File)
I do not see this option in IIS 8.5, only an option to 'Add Virtual Directory...'
Google is not helping today. Does anyone know how this can be accomplished?
I was not able to find a way to do this similar to how you can in IIS 6, maybe there is a powershell command...
However, I did find a way to add sites via the applicationHost.config file, which is usually located at: C:\Windows\System32\inetsrv\config. (be sure to make a back up of the file in case you make a booboo).
Since I have similar sites and apps, it is was easy to copy and paste, and modify the necessary fields.
You can add sites and app pools in the section:
<system.applicationHost>
App Pools:
<applicationPools>
...
Sites:
<sites>
If you have applications under a site then there has to be a corresponding location node:
<location path="Default Web Site/yoursiteapp">
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
<access sslFlags="None" />
</security>
</system.webServer>
</location>
I am trying to set up a website under IIS 7.5 with multiple tcp.net bindings.
Since the service is behind a loadbalancer I need multiple endpoints for the service:
log.o1881.no/log/service.svc
log.core1.o1881.no/log/service.svc
this works for the http bindings when I configure in web.config:
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
The following error message appears when the following tcp.net bindings are added to the site:
808:log.o1881.no
808:log.core1.o1881.no
Server Error in '/Log' Application.
This collection already contains an address with scheme net.tcp. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item
I also tried to add this to web.config:
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
<baseAddressPrefixFilters>
<add prefix="net.tcp://log.o1881.no:808/log" />
<add prefix="net.tcp://log.core1.o1881.no:808/log" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
This does however not work.
Since the service will be deployed on multiple servers, I would very much like to be able to make this work through configuration and IIS setup, not in code.
Is this possible to do, or is there another way to handle this scenario (multiple binding names on http and net.tcp, due to loadbalancing)?
According to the documentation the use of multipleSiteBindingsEnabled tells WCF to ignore any <baseAddressPrefixFilters>.
"Any baseAddressPrefixFilters settings are ignored, for both HTTP and non-HTTP protocols, when multiple site bindings are enabled using this setting."
So this configuration contradicts itself, you are specifying address prefixes and simultaneously instructing WCF to ignore them since you are have multipleSiteBindingsEnabled specified.
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
<baseAddressPrefixFilters>
<add prefix="net.tcp://log.o1881.no:808/log" />
<add prefix="net.tcp://log.core1.o1881.no:808/log" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
I think the multipleSiteBindingsEnabled is best for scenarios where you are only interested in using HTTP schemes.
Otherwise don't use it and you can in fact have multiple tcp.net bindings on different ports in the same IIS Site/App hierarchy.
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="net.tcp://log.o1881.no:808/log" />
<add prefix="net.tcp://log.core1.o1881.no:808/log" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
Hope this helps others :)
For as far as I've found, this is impossible:
Supporting Multiple IIS Site Bindings
Endpoint Addresses
How can WCF support multiple IIS Binding specified per site ?
If anyone finds a solution for this, please share...