Same Logical Path for Multiple Instances of ColdFusion - coldfusion

I am running two instances of CF9. Both instances have a Logical Path called SharedCode mapped under Mappings that point to two different directories. However, when I reference the mapping from the second instance, it points to the directory mapped in the first (default) instance.
The mappings are like so:
Default instance: SharedCode --> D:\Websites\SharedCode
Second instance: SharedCode --> D:\Websites\CF2\SharedCode
My code to reference the mapping as such: SharedCode\cfc\foo.cfm. If I run expandPath('\SharedCode'\) in the second instance, it outputs D:\Websites\SharedCode\
After some investigation, it looks as though ColdFusion does not allow mappings with the same Logical Path in separate instances. Is this true, and is there a solution that doesn't involve making each Logical Path unique?

Sounds like the code running in your second instance isn't actually connected to the second instance. You can check by dumping the server scope in each instance and see if they reference the same root directory. If they are the same, you'll need to use the Web Server Configuration tool to configure your web sites to use the correct CF instances.

Related

How to Exclude Application Definition from Import in Oracle Apex

I need to have different values in substitution strings in DEV and PROD. How do I prevent overwriting the substitution strings when updating PROD. DEV and PROD are in separate databases.
I don't see how to exclude the application definitions in build options.
Is there a better way to meet this requirement?
Thanks
The way I see it, substitution strings are application items defined as constants. Only use them for strings that are always the same in any deployment instance of the app. As soon as the value needs to be changeable (for example dev has different value than prod), use application items instead.
If you insist on doing this with build options then this is an option:
Set the values of the application items using a computation or an application process (this is for for production).
Create a 2nd set of computations or an app process with a sequence higher than the sequence of the one above (so this will override the original values) and set a build option on those (exclude on export).
That way, when you export the app, only the first set of computations / app process will be included.
However, my preference is to configure this in the database and have a settings table that has a record indicating the status of the environment (prod/dev/stage/uat) and store the strings in a custom messages table (one record per app status/application item) . In an application process or computation get the value of the application items. The reason I prefer this is that the app doesn't need to know if it is dev or prod, but the database should. This option has a couple of challenges if the same database and schema is used for prod and dev.

Creating new instances + hosts file

So I have been trying to create an Ansible playbook which creates a new instance to GCP and create a test file inside that instance. I've been using this example project from Github as template. In this example project, there is ansible_hosts -file which contains this host:
[gce_instances]
myinstance[1:4]
but I don't have any idea what it is doing actually?
The fragment your provided is Ansible technology and not actually related to anything GCP specific. This is a good reference doc: Working with Inventory.
At a high level,
[gce_instances]
myinstance[1:4]
the hosts file defines the machine identities against which Ansible is to execute against. With the hosts file, you can define groups of hosts to allow you to apply ansible playbooks to subsets of hosts at a time.
In the example, a group is created that is called gce_instances. There is nothing special or magic about the name. It isn't any kind of key word/phrase special to our story.
Within a group, we specify the hostnames that we wish to work against.
The example given is a wild-card specifier and simply short-hand for:
[gce_instances]
myinstance1
myinstance2
myinstance3
myinstance4

AWS Route53: Wildcard in secondary record set (*-Secondary) not working on failover

I configured a primary and secondary record sets in AWS Route53.
I am using an ALB (Application Load Balancer) for my primary, and a Web hosted S3 static page for my secondary. So both Record Set type is set as CNAME.
The name of the Record Sets:
Primary: route53.samplesite.net
Secondary: route53.samplesite.net
I was able to redirect my page to the secondary whenever the primary is down.
However I have one problem. My primary is consisted of several applications that works independently. When I say independently, I meant that I do the maintenance to each application separately so they are down at different times.
So, there's domain1, domain2, domain3 and so on set as my primary.
I wanted to set only one Secondary page for all my primary records and was hoping that it could work once I changed the domain name of the secondary to:
*.samplesite.net
and leave the primary to route53.samplesite.net,route53-2.samplesite.net, etc...
This is the only approached I tried but it is not working.
I know that it will work if I set a different secondary for each primary but is there any easier and a better way to accomplish my goal above?
No, there isn't.
On the right hand side, the * is not interpreted the same way it is on the left. It gets no special treatment as a target.
There is no way in Route 53 to map *.example.com to reference e.g. *.example.org so that for any value, the answer contains the same prefix with a different suffix. You'll need to configure them individually.

Is it possible to edit configuration nodes in a Node-Red flow?

In Node-Red, I'm using some Amazon Web Services nodes (from module node-red-node-aws), and I would like to read some configuration settings from a file (e.g. the access key ID & the secret key for the S3 nodes), but I can't find a way to set everything up dynamically, as this configuration has to be made in a config node, which can't be used in a flow.
Is there a way to do this in Node-Red?
Thanks!
Unless a node implementation specifically allows for dynamic configuration, this is not something that Node-RED does generically.
One approach I have seen is to have a flow update itself using the admin REST API into the runtime - see https://nodered.org/docs/api/admin/methods/post/flows/
That requires you to first GET the current flow configuration, modify the flow definition with the desired values and then post it back.
That approach is not suitable in all cases; the config node still only has a single active configuration.
Another approach, if the configuration is statically held in a file, is to insert them into your flow configuration before starting Node-RED - ie, have a place-holding config node configuration in the flow that you insert the credentials into.
Finally, you can use environment variables: if you set the configuration node's property to be something like $(MY_AWS_CREDS), then the runtime will substitute that environment variable on start-up.
You can update your package.json start script to start Node-RED with your desired credentials as environment variables:
"scripts": {
"start": "AWS_SECRET_ACCESS_KEY=<SECRET_KEY> AWS_ACCESS_KEY_ID=<KEY_ID> ./node_modules/.bin/node-red -s ./settings.js"
}
This worked perfect for me when using the node-red-contrib-aws-dynamodbnode. Just leave the credentials in the node blank and they get picked up from your environment variables.

Amazon Web Services - CreateDBSnapshot

I am completely new to Amazon Web Services, however, I did get an account and I am able to browse our list of servers. I am trying to create a database backup programmatically using .NET. I have installed AWS for .NET and I have built and run the sample Empty console program.
I can see that I can create an instance of the RDS service with the following line:
AmazonRDS rds = AWSClientFactory.CreateAmazonRDSClient(RegionEndPoint.USEast1);
However, I notice that the rds.CreateDBSnapshot(); needs a request object but I don't see anything like CreateDBSnapshotRequest in the reference .dll, can anyone help with a working example?
Like you said CreateDBSnapshotRequest is the parameter you have to pass to this function.
CreateDBSnapshotRequest is defined in the Amazon.RDS.Model namespace within the AWSSDK.dll assembly (version 1.5.25.0)
Within CreateDBSnapshotRequest you must pass the the DB Instance Identifier (for example mydbinstance-1), that you defined when you invoked the CreateDBInstance (or one of it's related methods) and the identifier for the snapshot you wish to generate (example: my-snapshot-id) for this DB Instance.
edit / example
Well there are a couple ways to achieve this, here's one example - hope it clears up your doubts
using Amazon.RDS;
using Amazon.RDS.Model;
...
...
//gets the credentials from the default configuration
AmazonRDS rdsClient = AWSClientFactory.CreateAmazonRDSClient();
CreateDBSnapshotRequest dbSnapshotRequest = new CreateDBSnapshotRequest();
dbSnapshotRequest.DBInstanceIdentifier = "my-oracle-instance";
dbSnapshotRequest.DBSnapshotIdentifier = "daily-snapshot";
rdsClient.CreateDBSnapshot(dbSnapshotRequest);
Dont't forget that the DB Instance (in the example my-oracle-instance) must exist (duh :) and must be in the available state, like this: