Create CGI Custom Server variable in Coldfusion 2018 - coldfusion

I'm using Coldfusion Builder 2018 and running a coldfusion application in local. This application was protected with SSO and the server is setting CGI variables in Dev/Prod. I want to override this CGI variable in my local server to run the application.
Can someone help me on how to override the CGI variable in local?

I think your best bet is to create your own abstraction instead. So create a function / CFC that you get your variables from. Depending on environment you can get these from configuration (or something else), and in prod you can honour the CGI variables. I am not sure you can override CGI variables.

Related

Using "Vars" in RStudio Connect Shiny Apps

So I can see there is a "VARS" option to set up environment variables in a a published Shiny App. However I am a bit confused as to how to use them. I need to do my testing and developing in RStudio Workbench (we are using RStudio Connect).
So how do I develop a Shiny app to use environment variables in a Workbench project, and then tie these to the VARS in the deployed Shiny App? The information seems very vague on this, but just being able to set "VARS" after I published something, isnt much use if it does not provide information on how I develop the solution in Workbench prior to publishing.
I have no access to the server, so cant set OS level environment variables.

How web servers gives data to script?

I have some experience with php / python programming and i am curious to know how actually servers like apache / light httpd gives data to the script?
Can it be bypassed to a c/c++ program ? and handled via that?
Sorry for this kinds of question. I am too much curious. Googled it but can not find a really good answer.
Today, probably the most used and with less overhead is SAPI:
http://en.wikipedia.org/wiki/Server_Application_Programming_Interface
Some examples of SAPI is ISAPI that is mostly for IIS, Apache modules for Apache,
and the list extends with Servers.
ISAPI:
Uses a system dynamic linked library (DLL) so it "attach" to the webserver and functions
can be called direct on it.
http://en.wikipedia.org/wiki/Internet_Server_Application_Programming_Interface
CGI: http://www.w3.org/CGI/
normally a new process is created for each request, the data from the server is normally passed in stdin and the program writes to stdout, some information is passed as environment variables.
FastCGI: http://www.fastcgi.com/drupal/
As the name suggest, its like CGI but does not need to run the program every time a request is made, being faster and using less resources.
Xitami have their own too, called LRWP http://legacy.imatix.com/html/xitami/index12.htm
But each server can implement their own.
Note: The module or external program is what parses the script. The SAPI, CGI, FastCGI and whatever will integrate with the interpreter of the script, a binary. The interpreter then receive the request path, find the script file, and parse it.
Ex: PHP has its apache and IIS modules.
These things follow a request-response pattern where a request is made to a web server. The web server will process the request and execute any server side code (script) associated with the url that the request resolves to (web service or web page typically). The script will execute and result in a response that is sent back to the caller.

Common practice for setting environment variables in Django?

I'm very new to the Django framework. I am writing an app, and I would like to set a number of environment variables before the server is run. Is there a standardized approach to doing this (i.e. a setup script that is run before the server startup is completed)?
It depends upon webserver you want to use. For example apache with mod_wsgi you can add your variables in the os.environ. Refer WSGI IntegrationWithDjango
However, in general updating os.environ in setttings.py would also work.

Compile JSP & Java on browser refresh - Tomcat

Is there any way to setup Tomcat server so whenever I make changes to Java class or JSP page the change is visible on browser refresh.
I'm bored stopping and starting Tomcat. I want to configure Tomcat like the way WAMP works [where you can see the PHP code change upon browser refresh]
If it's for development mode that's ok. Don't use it for production stuff.
You don't have to restart the server. You can restart the app through the Tomcat Manager.
You can even do this directly as: http://[hostname]:[port]/manager/reload?path=[/path/to/your/webapp]
or
Define your context as reloadable
Be careful: It is NOT recommended to place elements directly in the server.xml file
Check out the Tomcat configuration guide
For java classes: reloadable
Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
NOTE - The value for this property will be inherited from the reloadable attribute you set on the surrounding Context component, and any value you explicitly set here will be replaced.
(http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html)
For JSP: development ($CATALINA_BASE/conf/web.xml)
development - Is Jasper used in development mode? If true, the frequency at which JSPs are checked for modification may be specified via the modificationTestInterval parameter.true or false, default true.
Hope this helps

Django views that are inaccessible publicly but accessibly internally?

I have a few views I want to expose to apps internal to the server cluster. How can I do this securely?
The apps that want to access these restricted views are also using python, so if I can arguably bypass the HTTP tunneling and call directly to them, that's even better. I think these would be better suited as commands if that's the case, but how can another process invoke a Django environment's commands?
Once you load the project's settings you can act as the project itself.
It sounds like you basically want to extract some data from your Django site and use it elsewhere. Perhaps a couple of management commands that periodically output their data in some directory which you can then read from the other python apps? Depends on your data needs whether that's an option.
I'm doing this suggestion as those other apps seem to be on the same server (how could you otherwise run your site's python code from those apps?).