production-environment

Auto detect internal/external development environment

╄→гoц情女王★ 提交于 2019-12-03 00:20:28
We use the following function to auto detect if we are on a machine internally or on a live server and then choose the appropriate configs for various components: function devIsLocal(){ $res=false; $http_host=$_SERVER['HTTP_HOST']; if($http_host=='localhost')$res=true; if($http_host=='127.0.0.1')$res=true; if(substr($http_host,-4)=='.lan')$res=true; if(strpos($http_host, '.')===false)$res=true; return($res); } As you can see it only relies on the HTTP_HOST value. Of course, if you use some sort of virtual host locally like example.com then the function will be tricked. Are there any other ways

What are the right ownership & permissions to the CakePHP app/tmp folder for production?

不想你离开。 提交于 2019-12-02 19:44:27
I would like to know the answers and explanation to the following questions: Which user/group should own the cake files? If different, which user/group should own the app/tmp folder? (and subfolders) With the right user/group, what are the correct permissions for production of both folders and files? (which also if set correctly should work on development) Where is storing of uploaded files done and what ownership/permissions need to be set to that folder. Where should it be relative to app/ ? I know 777 fixes errors, but I would like to set it up correctly. I have heard 660 should be more

How to start passenger in production environment?

こ雲淡風輕ζ 提交于 2019-12-02 18:50:57
I'm starting the Rails 3 application with the following command: passenger start -a 0.0.0.0 -p 3000 -d but how do I tell passenger to start the application in production environment? passenger start -a 0.0.0.0 -p 3000 -d -e production Side note: always check the help, passenger start --help would have told you the same. 来源: https://stackoverflow.com/questions/7260961/how-to-start-passenger-in-production-environment

Server unable to find public folder in rails 3 production environment

老子叫甜甜 提交于 2019-12-02 17:59:24
I'm using the latest rails 3 beta. The app works fine in development mode, but when I start the server in production mode via rails server -e production , it seems that the public folder can't be found. I get error messages like: ActionController::RoutingError (No route matches "/javascripts/jquery.js"): And similar messages for everything that should be in the public folder. I've tried this with both mongrel and webrick. I'd appreciate any help. editing config/environments/production.rb and setting this line: config.serve_static_assets = true nginx, unicorn and apache will do this

“require_tree argument must be a directory” rails 3.1.1 precompile assets

﹥>﹥吖頭↗ 提交于 2019-12-02 15:51:08
I've been round and round here with trying to get the assets to pre-compile on my production server (straightforward ubuntu install with ruby 1.9.2 and Rails 3.1.1, and tried 3.1.2RC with the new sprockets 2.10 as well). "require_tree argument must be a directory". I've seen other issues related to this on stack but the situation isn't exactly the same and none of the proposed solutions have helped – like create a stub file in the sub folder, then reference only relatively at that point. No luck. And to top it off, of course this works perfectly on all development machines (mac's but with

Canary release strategy vs. Blue/Green

三世轮回 提交于 2019-12-02 13:48:56
My understanding of a canary release is that it's a partial release to a subset of production nodes with sticky sessions turned on. That way you can control and minimize the number of users/customers that get impacted if you end up releasing a bad bug. My understanding of a blue/green release is that you have 2 mirrored production environments ("blue" and "green"), and you push changes out to all the nodes of either blue or green at once, and then use networking magic to control which environment users are routed to via DNS. So, before I begin, if anything I have said so far is incorrect,

Rails 5 - JS not working in production environment (only)

倖福魔咒の 提交于 2019-12-02 06:40:40
问题 I am struggling. I have rails 5 app with a series of js files in my app/assets/javascripts folder. The js in those files works just fine in the development environment, but when I publish on heroku, it stops working. I can see from the chrome inspector, that the application.js file that is visible from the network tab shows the content of the js files in my app. That js just doesnt seem to do anything in production. No console errors appear from the chrome console inpsector. I can see from

Runtime error stacktrace or location in VB6

一笑奈何 提交于 2019-12-01 22:16:02
问题 I maintain an old application written in VB6. In client's environment it raises runtime errors which I can't reproduce under debugger. Is there any way to get the stacktrace or location of error? I mean, without putting trace statements all over the code like here or adding error handlers for logging to every procedure like here. It seems to be a simple question. Sorry. I just don't know VB6 very well. And it is surprisingly hard to google out any information, considering how widely it is (or

Where should I store the connection string for the production environment of my ASP.NET Core app?

ぃ、小莉子 提交于 2019-12-01 17:38:13
Where should the production and staging connection strings be stored in an ASP.NET Core application, when deploying into IIS 7 (not Azure) ? I am looking for the recommended way of doing it / best-practice, especially security-wise. In ASP.NET 5 it's possible to specify multiple configuration sources. Thanks to this welcoming change to previous model you can store your development connection string in simple json file, and your staging and production connection string in environment variables directly on the respective servers. If you configure your app like this : var config = new

iPhone push-notification works in sandbox but not in production mode

六眼飞鱼酱① 提交于 2019-12-01 05:44:58
As the title says, I have an app with built in APNS. It does work perfectly in Sandbox-mode. But in production-mode, it fails miserably. It seems that I have the right certificates on the server, because I don't get an error back from the APNS-Service. Everything seems to work fine. I am using ApnsPHP by Aldo Armiento. It has a built-in function to spit out the results from the APNS-Server. When I try to use the Sandbox with the app from the store, I get - as expected - an invalid-token-error (since tokens from sandbox and production are different). When I use the production-certificate with