Before I start I would like to say that I have read and tried all methods/solutions I can find on this and other forums to no avail.
I have a simple mail setting entry in my webconfig that I want transformed when publishing to test environment etc.
This is the main config that uses my local settings
<system.net>
<mailSettings>
<smtp from="p.carey#sentinelwater.co.uk">
<network host="SENTINEL-SBS" port="25" />
</smtp>
</mailSettings>
</system.net>
and this is one of the attempted transforms
<system.net>
<mailSettings>
<smtp from="noreply#test.managemywater.co.uk" xdt:Transform="Replace">
<network xdt:Transform="Replace" host="localhost" port="25" />
</smtp>
</mailSettings>
</system.net>
It simply fails on replacing 'host' with localhost and maintains SENTINEL-SBS. I have no idea if it attempts to replace 'from'.
I have run out of ideas and will have to resort to translating Japanese forums now!!!
No doubt there is a simple answer but I'll be damned if I can find it.
I have an addition transform for the connection string using 'add name' and that works fine.
Related
I was given a weird requirement of hosting small campaign websites with 5-6 pages written in Angular and some APIs these websites can interact with. Everything coming from a WildFly instance.
I configured the paths and handlers using WildFly/Jboss' Undertow subsystem for each of these campaign portals. Their home page shows up when tried to access the the server with the path. Here's the example:
<subsystem xmlns="urn:jboss:domain:undertow:11.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
<https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
<host name="default-host" alias="localhost">
<location name="/app1" handler="app1"/>
<location name="/app2" handler="app2"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="app1" path="${jboss.home.dir}/app1" directory-listing="true"/>
<file name="app2" path="${jboss.home.dir}/app2" directory-listing="true"/>
</handlers>
</subsystem>
However if I click any of the links inside the landing/index page within these apps, I get 404 - Not Found.
Ex: https://myhost.mydomain.com/app1 -> Gives the landing/index page.
Any link I click within that page, for instance, if there is 'faqs' and the URL is https://myhost.mydomain.com/app1/faqs, it resolves fine to that path but I am getting 404 - Not found.
Looking for a way to make this work.
I can not figure out how to set and read environment variables in Microsoft Internet Information Services (IIS) version 10. I have a Fast CGI app that requires environment variables. In previous versions of IIS I just set system-wide variables in the Windows "System Properties". However in IIS 10 my FCGI app isn't reading them. So my first question is if there are steps that need to be taken so that the IIS process can read system variables?
Alternatively, how do I set environment variables within IIS 10? This Microsoft site explains it but not in enough detail for me to get it working. Specifically, in what file and in which section do you put the <environmentVariables> section? The example XML and the command line example have name="Contoso" (see below) but what is that - the name of the application pool, or my FCGI app, or something else?
<applicationPools>
<add name="Contoso" managedRuntimeVersion="v4.0" managedPipelineMode="Classic">
<environmentVariables>
<add name="foo" value="bar" />
</environmentVariables>
</add>
</applicationPools>
Edit in response to Jokies Ding:
MAP22 and PROJ_LIB are the two environment variables that I need. In C:\Windows\System32\inetsrv\Config\applicationHost.config
I have:
<applicationPools>
<add name="DefaultAppPool" />
<add name=".NET v4.5 Classic" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" />
<add name=".NET v4.5" managedRuntimeVersion="v4.0" />
<add name="ASP.NET v4.0" autoStart="true" managedRuntimeVersion="v4.0" />
<applicationPoolDefaults managedRuntimeVersion="v4.0">
<processModel identityType="ApplicationPoolIdentity" />
<environmentVariables>
<add name="PROJ_LIB" value="/gdal/bin/proj6/SHARE" />
<add name="MAP22" value="/tetonwy/mapserv/main.map" />
</environmentVariables>
</applicationPoolDefaults>
</applicationPools>
and
<fastCgi>
<application fullPath="C:\gdal\bin\ms\apps\mapserv.exe">
<environmentVariables>
<environmentVariable name="MAP22" value="C:\tetonwy\mapserv\main.map" />
<environmentVariable name="PROJ_LIB" value="C:\gdal\bin\proj6\SHARE" />
</environmentVariables>
</application>
</fastCgi>
and in a cmd window the environment variables are visible
C:\>set MAP22
MAP22=C:\tetonwy\mapserv\main.map
C:\>set PROJ_LIB
PROJ_LIB=C:\gdal\bin\proj6\SHARE
So it seems like I've got the variables set all over the place but the app isn't seeing them. C:\gdal\bin\ms\apps\mapserv.exe is the FastCGI app that isn't seeing the environment variables. It's a compiled C program that I have used in previous versions of IIS.
There is an issue with MapServer not reading environment variables on Windows when used through FastCGI.
This is resolved by applying https://github.com/MapServer/MapServer/pull/6304 which will be backported to the 7.x MapServer releases.
See Environment variables ignored using FastCGI and IIS #6289 for more details.
<environmentVariables> section is displayed as a collection under specific application pool.
You could find it in IIS global configuration file C:\Windows\System32\inetsrv\config\applicationhost.config.
"Contoso" is the name of application pool.
I think read system-wide variable is still supported in IIS 10 and PHP FAST-CGI. I can get these configuration by running commandline SET in IIS PHP-CGI.
Could you post the code that you used to read the variable?
In some condition, Your application code require elevated permission. You could try to change application pool identity to local system and set Anonymous authenticated user to Application pool identity
I have a FS server running on one server and on a remote server I have a Node JS instance controlling it using node_esl (a Node JS Event Socket library for FS).
Every time I'm sending a request to the server I have the following error:
[WARNING] mod_event_socket.c:2603 IP ::ffff:192.168.59.3 Rejected by acl "loopback.auto"
FS server has 2 interfaces: one is using a public IP and the second one is on a private network (192.168.59.0/24).
I checked the acl.conf.xml file and event_socket.con.xml and I do not see anything special so far.
One last thing: this is a dev environment and FS is running in a VM (VirtualBox). The interface used for the VM is 192.168.59.103 and the GW is 192.168.59.3
So this might be a NAT issue if not an ACL issue (or both).
Do you have any idea of what the ACL configuration should be?
You must go to FreeSWITCH/conf/autoload_configs/event_socket.conf.xml and uncoment and edit acl line:
<param name="apply-inbound-acl" value="loopback.auto"/>
you must write something like my_acl instead of loopback.auto
After that you must go to FreeSWITCH/conf/autoload_configs/acl.conf.xml and there write something like this:
<list name="my_acl" default="deny">
<node type="allow" cidr="xxx.xxx.xxx.xxx/32"/>
<node type="allow" cidr="xxx.xxx.xxx.0/24"/>
</list>
After this go to fs_cli and tape command:
reloadacl
Enjoy!
EDIT:
Make sure following:
<list name="my_acl" default="deny">
<node type="allow" cidr="xxx.xxx.xxx.xxx/32"/>
<node type="allow" cidr="xxx.xxx.xxx.0/24"/>
</list>
becomes:
<list name="my_acl" default="deny">
<node type="allow" cidr="xxx.xxx.xxx.xxx/32"/>
<node type="allow" cidr="xxx.xxx.xxx.0/24"/>
<node type="allow" cidr="192.168.42.42/32"/>
<node type="allow" domain="$${domain}"/>
<!-- this allow fs_cli to connect else fs_cli wont work --!>
<node type="allow" cidr="127.0.0.1/32" />
</list>
I found out why:
ACL was not really that well configured. The one used was not opening the right connection for event_socket. So either Event_Socket was opened for local use only or for external use only.
Had to recreate a new ACL with local access opened (necessary if you want to use fs_cli) and adding the IPs of the controlling servers.
Thx for your suggestion regarding IPv6, I tested it earlier and found out it has no effect on my "issue"
There's some info on how to get it to work here:
https://wiki.freeswitch.org/wiki/Mod_event_socket#Configuration
After a bit of trial and error, all I had to do to get rid of the error was the following:
Open FreeSWITCH/conf/autoload_configs/event_socket.conf.xml
Uncomment the following line:
<param name="apply-inbound-acl" value="loopback.auto"/>
Here's my working event_socket.conf.xml file:
<configuration name="event_socket.conf" description="Socket Client">
<settings>
<param name="nat-map" value="false"/>
<param name="listen-ip" value="::"/>
<param name="listen-port" value="8021"/>
<param name="password" value="ClueCon"/>
<param name="apply-inbound-acl" value="loopback.auto"/>
<!--<param name="stop-on-bind-error" value="true"/>-->
</settings>
</configuration>
I manually created loopback.auto list under acl.conf.xml
<list name="loopback.auto" default="allow">
<node type="allow" cidr="172.31.0.0/16"/>
<node type="allow" cidr="52.67.85.153/32"/>
</list>
Where 172.31.0.0/16 is Freeswitch local IP address.
In event_socket.conf.xml file I leave loopback.auto:
<param name="apply-inbound-acl" value="loopback.auto"/>
Then run reloadacl and reloadxml. In my case I needed to restart Freeswitch to make it work.
It could happen because of IPv6 issue:
https://freeswitch.org/jira/browse/FS-7638
As a workaround, you can try to change event_socket bind address from :: to 192.168.59.x in autoload_configs/event_socket.conf.xml
I'm running the latest version of Glimpse and running the site locally shows the Glimpse bar bottom right but not when hosted on Azure.
I've done everything in this post which says to add the following to the web.config:
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
<inspectors>
<ignoredTypes>
<add type="Glimpse.Mvc.Inspector.DependencyInjectionInspector, Glimpse.Mvc4"/>
</ignoredTypes>
</inspectors>
<runtimePolicies>
<ignoredTypes>
<add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"/>
</ignoredTypes>
</runtimePolicies>
</glimpse>
The official docs don't mention the inspectors node but it doesn't work when I try without it either.
I tried adding:
<logging level="Trace" />
but can't see where that would be output.
When I go to glimpse.axd it correctly hides the warning message that I see on local:
Glimpse.AspNet.Policy.LocalPolicy *This policy means that Glimpse won't run remotely.*
Any ideas on a solution?
As I was on MVC and Azure I needed to do both steps listed here.
Then in views/web.config add:
<add namespace="Glimpse.Mvc.Html" />
In your Web.config add the runtimePolicy as below.
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd" >
<runtimePolicies>
<ignoredTypes>
<add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"/>
</ignoredTypes>
</runtimePolicies>
</glimpse>
And then add #Html.GlimpseClient() to the end of your Layout page.
No idea why this second part is necessary for remote and not local, but it worked for me.
IISExpress writes log and configuration data to pre-determined location out of the box.
The directory is an "IISExpress" directory stored in a user's Documents directory.
In the directory is stored the following folders files underneath.
Config
Logs
TraceLogFiles
The location of my home directory is on a network share, determined by group policy
Currently we are encountering scenarios where visual studio locks up when stopping debugging Silverlight applications using IIS Express.
I was looking to change the location for the log & configuration data for IISExpress to see if this fixes the problem of visual studio locking up. Is it possible to change the default location of log & config files ?
1 . By default applicationhost.config file defines following two log file locations. Here IIS_USER_HOME would be expanded as %userprofile%\documents\IISExpress\.
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" />
</siteDefaults>
You can update above directory paths to change the log file locations.
2 . If you are running IIS Express from command line, you can use '/config' switch to provide configuration file of your choice. Following link may help you http://learn.iis.net/page.aspx/870/running-iis-express-from-the-command-line/
http://www.iis.net/configreference/system.applicationhost/sites/sitedefaults
<configuration>
<system.applicationHost>
<sites>
<siteDefaults>
<logFile
logFormat="W3C"
directory="%SystemDrive%\inetpub\logs\LogFiles"
enabled="true"
/>
<traceFailedRequestsLogging
enabled="true"
directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles"
maxLogFiles="20"
/>
<limits connectionTimeout="00:01:00" />
<ftpServer serverAutoStart="true" />
<bindings>
<binding
protocol="http"
bindingInformation="127.0.0.1:8080:"
/>
</bindings>
</siteDefaults>
</sites>
</system.applicationHost>
</configuration>
I find web.config documentation is a messy. It is therefore better to provide a complete parent history than a floating snippet with the expectation that the reader naturally knows where it goes.
By default it will be in:
C:\Users\ user_name \Documents\IISExpress\Logs\