Web2py default app - dns

I am planning to publish my site soon on Dreamhost using passenger WSGI as mentioned in the dreamhost setup documentation.
My issue is that I am wanting www.mydomain.com to go directly to my new application, instead of needing to go to web2py.mydomain.com/MyApp/Default.
What is the best way to solve this issue? Do I use DNS redirects or can this be done through the web2py configuration?

Another option available since web2py version 1.83 (Aug 11, 2010):
Default Application, Controller, and Function
The name of the default application, controller and function can be changed from init, default, and index respectively to another name by setting the appropriate value in routes.py:
default_application = "myapp"
default_controller = "admin"
default_function = "start"

You can in web2py. You have two options:
1) call your app "init"
2) use routes to do the mapping. Create a file web2py/routes.py and in it add
routes_in=[('/','/MyApp/default/index')]

Related

How to instantiate a blank workspace in node red?

I have an < iframe > based Node-Red UI hosted inside MEAN application. I want to create a blank workspace each time I visit the Node-Red hosted Page without restarting NR server?
But I also need to preserve the previously deployed flows.
I've tried changing user directory to scratch :
var settings = {
httpAdminRoot:"/red/",
httpNodeRoot: "/api/",
userDir:"/home/sudo/.nodered/scratch",
functionGlobalContext: { } // enables global context
};
but it wouldn't work instead it started creating persistent flow file inside the scratch directory.
You can't do what you want with the default Node-RED. It will always store the flow in a file in the userDir
You will need to look at implementing your own storage module as described here: http://nodered.org/docs/api/storage/

Swashbuckle running with katana-owin based web api doesnt work with IIS but works with IIS Express

I think I have a similar issue as this post-
Webactivator doesn't run on IIS 7
Swashbuckle running with katana-owin based web api is able to work with IIS Express.
assume all the urls below have an "http" prefix.
I can browse to something like localhost:8085/swagger Which redirects me correctly to localhost:8085/swagger/ui/index
But when published to IIS redirects to localhost/swagger/ui/index instead of localhost/myapp/swagger/ui/index and this results in a 404. Notice that even though an application name is specified while publishing somehow swashbuckle/swagger doesn't know and only uses the pathbase without the application name.
basically it just picks up the site root URL instead of the application URL that was used to call /swagger
Any solution to this problem?
I got the same issue. Solved this using the following code (c.RootUrl)
config.EnableSwagger(c =>
{
c.IncludeXmlComments(GetXmlCommentsPath());
c.SingleApiVersion("v1", "yourAPI");
c.RootUrl(req => req.RequestUri.GetLeftPart(UriPartial.Authority) + VirtualPathUtility.ToAbsolute("~/").TrimEnd('/'));
});
Reference : Relative path for UI request URL

Is it possible to change default sharepoint 2013 app url

The default app url looks like http://[app prefix]-[app id].[domain name]/[site collection path]/[app path]/pages/default.aspx.
It is unconvinient because every deployment during development generates new url. And after development stage the end users need a permanent link to the application, but every bug fixes or updates that will be deployed will cause new app url generation. Is there right way to fix the app url?
You can create a URL controller:
Create a list that would contain two fields: fakeUrl, realUrl,
fakeUrl can be something like "http://staticappname.[domain name]/[site collection path]/[app path]/pages/default.aspx"
realUrl would be your http://[app prefix]-[app id].[domain name]/[site collection path]/[app path]/pages/default.aspx
Give your users fakeUrl
Create a HTTPModule that would read the list and redirect the http request to the realUrl
After you redeploy your app, just change the realUrl in the list
***I'm not if this is your case but you could change your app to be a provider-hosted. Then you would get a static Url
You can open your SharePoint hosted add-in using an alternate link like:
http://[SharePointSite]/[Add-inName]
For eg.
http://contoso.com/sharepointhostedapp/

How to change Hybris server's port

The default port is http://localhost:9001.
How do I run the hybris platform using another port?
Edit your {HYBRIS_ROOT_DIR}/config/local.properties file and use the following properties to configure the various ports:
tomcat.http.port=9001
tomcat.ssl.port=9002
tomcat.ajp.port=8009
tomcat.jmx.port=9003
tomcat.jmx.server.port=9004
You can find the complete configuration reference on the Hybris wiki here: https://wiki.hybris.com/display/release5/Configuration+Properties+Reference
In order for the changes to be applied you must run ant and restart Hybris.
You can run ant all, but if you have only changed the configuration you can deploy these changes without having to re-compile by using ant deploy which is much faster.
Create a /config/local.properties file with this content:
tomcat.http.port=9101
tomcat.ssl.port=9102
tomcat.ajp.port=8109
tomcat.jmx.port=9103
tomcat.jmx.server.port=9104
Then you'll get Hybris server to run on http://localhost:9101.
If you change the port, make sure you update the spring security port-mappings (should be already using the configuration service and these properties via Spring EL to do this if you're on a recent version of hybris), and, for local development, the site URL resolution (website.<x>.http(s), media.<x>.http(s)) properties and the CMS Site URL mapping regular expressions (ImpEx or hMC). There's also a property for jvdbc I think.
You can change these in the config/local.properties, platform/project.properties or a custom extension's project.properties. The local.properties file has the highest priority (if the property is defined in multiple places), then the custom extension's project.properties, and finally in the platform's project.properties.
In addition to the above configuration provided by Zathrus Writer. You might have to add the solr port configuration to have say two instances of hybris running in the same server.
solrserver.instances.default.port=8986
Full configuration:
tomcat.http.port=9201
tomcat.ssl.port=9202
tomcat.ajp.port=8209
tomcat.jmx.port=9203
tomcat.jmx.server.port=9204
solrserver.instances.default.port=8986
You can use this as well
hybris.instance.id=60
tomcat.http.port=9${hybris.instance.id}1
tomcat.ssl.port=9${hybris.instance.id}2
tomcat.jmx.port=9${hybris.instance.id}3
tomcat.debug.port=9${hybris.instance.id}0
tomcat.jmx.server.port=9${hybris.instance.id}4
tomcat.ajp.port=9${hybris.instance.id}5
Override port configurations in {HYBRIS_ROOT_DIR}/config/local.properties file.
tomcat.http.port=9011
tomcat.ssl.port=9012
tomcat.ajp.port=8019
tomcat.jmx.port=9013
tomcat.jmx.server.port=9014
In addition to the port we can also override xmx values of JVM in tomcat.generaloptions configurations in config/local.properties as listed below.
tomcat.generaloptions=-Xmx6G -XX:MaxPermSize=300M -ea -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dorg.tanukisoftware.wrapper.WrapperManager.mbean=true -Djava.endorsed.dirs="%CATALINA_HOME%/lib/endorsed" -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA_HOME% -Dfile.encoding=UTF-8 -Dlog4j.configuration=log4j_init_tomcat.properties -Djava.util.logging.config.file=jdk_logging.properties -Djava.io.tmpdir="${HYBRIS_TEMP_DIR}"
In addition, you may face with another port issue cause debug port.
You should also change it.
Please use;
tomcat.debugjavaoptions=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=n
As SAP Hybris runs on tomcat server, we can run as many servers as needed simultaneously based on our memory.
We need to configure in config/local.properties
To run tomcat in different port
tomcat.http.port=6001
tomcat.ssl.port=6002
tomcat.ajp.port=6009
tomcat.jmx.port=6003
tomcat.jmx.server.port=6004
os.rmiregistry.port=3198
website.electronics.http=http://electronics.local:6001/yacceleratorstorefront
website.electronics.https=https://electronics.local:6002/yacceleratorstorefront
website.apparel-de.http=http://apparel-de.local:6001/yacceleratorstorefront
website.apparel-de.https=https://apparel-de.local:6002/yacceleratorstorefront
website.apparel-uk.http=http://apparel-uk.local:6001/yacceleratorstorefront
website.apparel-uk.https=https://apparel-uk.local:6002/yacceleratorstorefront
website.powertools.http=http://powertools.local:6001/yb2bacceleratorstorefront
website.powertools.https=https://powertools.local:6002/yb2bacceleratorstorefront
To Run Solr in separate port
solrserver.instances.default.port=6983
To have debug in separate port
tomcat.debugjavaoptions=-Djava.locale.providers=COMPAT,CLDR -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=6000,suspend=n

Change configuration in runtime by changing environment variables using the module node-config

I'm trying to use the node-config module to change some parameters of my configuration (basically logging level) during runtime.
In the official documentation says:
Environment variables can be used to override file configurations. Any environment variable that starts with $CONFIG_ is set into the CONFIG object.
I've checked that this is true when the server starts but it does not seem to work once it's up. (The handler of the watch function is never called when an environment variable is changed unlike a change in the runtime.json file or directly changing a config variable).
I'm currently watching the whole CONFIG object like this:
var CONFIG = require('config');
CONFIG.watch( CONFIG , null , function(object, propertyName, priorValue, newValue){
console.log("Configuration change detected");
});
Does anyone know if this is possible?
The environment is available during startup of a process.
If the process is running, you won't be able to change the environment anymore, the process is in.
The only option is to restart the process or use other mechanisms to communicate with it.
Say for example having a rest or tcp listener inside, where you can transfer your variable inside.
Best regards
Robert
As you must knowing, React is a single page application which is eventually when it is complied is a static page app that means all the files of the react application is complied into vanilla JS and CSS file bundle in a Tarball. Now that Tarball is eventually deployed on a web server. It could be Apache web server, nginx web server or anything which you are using it but an important point is the static app is running in someone else browser and someone access to website CSS and JS are downloaded in a browser and it is running in the browser runtime environment so technically you cannot have a runtime environment variable for someone else browser but may be there would be a way to access them during runtime.
SOLUTION
I have achieved this goal with the package called runtime-cra.
follow the steps on this official documentation: https://blog.risingstack.com/create-react-app-runtime-env-cra/

Resources