production-environment

Node.js, express, and using development versus production in app.configure

混江龙づ霸主 提交于 2019-11-27 00:03:54
问题 What is the easiest method to let express know what environment I am in? E.g. I want do do the below to make a connection to redis depending on what env I am in. Can this be done from the command line? app.configure('development', function(){ app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); var r = require("redis").createClient(6379,'127.0.0.1'); }); app.configure('production', function(){ app.use(express.errorHandler()); r = redis.createClient(6379,'46.137.195.230',

Webrick as production server vs. Thin or Unicorn?

会有一股神秘感。 提交于 2019-11-26 23:54:55
问题 It seems like it's taken for granted that you must not use Webrick as production server, but I can't really find anywhere mentioning why. The consensus seems to be: "Webrick is ok for development, but Thin or Unicorn is the choice for production, period." I did look up Thin server's homepage and it talks about requests/second but I don't really understand the graph since there's no annotation. Can anyone let me know why I should use Thin or Unicorn compared to Webrick? Also is there any

Will enabling XDebug on a production server make PHP slower?

南笙酒味 提交于 2019-11-26 22:43:45
The title pretty much says it all...is it a bad idea ? I'd like to have the enhanced debug messages that XDebug provides on the server. [edit] Just to make things clear. I'm aware there are security risks involved. Perhaps I should complement my question and give more precise reasons why I would want to do this. Our production server hosts a testing platform also. Sometimes we use it to test things on a environment as close to production as possible. The main thing I'm looking for is using XDebug's enhanced var_dump() . This is not an app server for high traffic apps and performance is not

problem implementing wicked pdf on heroku

十年热恋 提交于 2019-11-26 22:37:35
问题 I am using this guide for integrating wicked_pdf on heroku. But somehow it doesn't seem to work. I got the logs from heroku and its says this: Processing PdfController#get_pdf to pdf (for 115.248.175.50 at 2011-02-15 23:54:44) [GET] Parameters: {"format"=>"pdf", "action"=>"get_pdf", "id"=>"1", "controller"=>"pdf"} ***************WICKED*************** Rendering pdf/get_pdf RuntimeError (PDF could not be generated! /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:73:in `exec': No such file or directory -

Moving app to production mode in Symfony 2

微笑、不失礼 提交于 2019-11-26 22:31:17
问题 Can someone help me to move my Symfony 2 application into production mode? Currently, the application is running properly in /app_dev.php . I'm googling, but I'm not finding a definite guide for deployment in Symfony 2. 回答1: Couple more things to consider: php app/console cache:clear --env=prod --no-debug php app/console assets:install web_directory php app/console assetic:dump web_directory You might also run into permission issues with the cache directory. I would actually first make sure

Access environment variables in production build Angular 4

我与影子孤独终老i 提交于 2019-11-26 20:57:16
I want to deploy a production build of angular app with a configurable api url for the user to test it out. I use the environment.ts but after the production build, I do not know how to configure the variables. What approach needs to be done? Are you using Angular-CLI? It should be easy, then. You have something like this: src/ app/ environment/ environment.ts environment.prod.ts Simply put different url in environment.prod.ts and your prod build gets a second url. E.g. let's say your environment.ts looks like this: { "production": false, "apiUrl": "http://localhost:8080" } Put this in

How to configure MongoDB Java driver MongoOptions for production use?

北城余情 提交于 2019-11-26 18:43:14
问题 I've been searching the web looking for best practices for configuring MongoOptions for the MongoDB Java driver and I haven't come up with much other than the API. This search started after I ran into the "com.mongodb.DBPortPool$SemaphoresOut: Out of semaphores to get db connection" error and by increasing the connections/multiplier I was able to solve that problem. I'm looking for links to or your best practices in configuring these options for production. The options for the 2.4 driver

How do I prevent node.js from crashing? try-catch doesn't work

给你一囗甜甜゛ 提交于 2019-11-26 16:54:58
From my experience, a php server would throw an exception to the log or to the server end, but node.js just simply crashes. Surrounding my code with a try-catch doesn't work either since everything is done asynchronously. I would like to know what does everyone else do in their production servers. Other answers are really insane as you can read at Node's own documents at http://nodejs.org/docs/latest/api/process.html#process_event_uncaughtexception If someone is using other stated answers read Node Docs: Note that uncaughtException is a very crude mechanism for exception handling and may be

Ruby on Rails production log rotation

左心房为你撑大大i 提交于 2019-11-26 16:52:14
What is the best way to enable log rotation on a Ruby on Rails production app? Is it by using logrotate on the hosting server or is there a set of options to use when initialising logger from the app? Option 1: syslog + logrotate You can configure rails, to use the systems log tools. An example in config/environments/production.rb . # Use a different logger for distributed setups config.logger = SyslogLogger.new That way, you log to syslog, and can use default logrotate tools to rotate the logs. Option 2: normal Rails logs + logrotate Another option is to simply configure logrotate to pick up

Setup sunspot solr with rails in production environment

一笑奈何 提交于 2019-11-26 11:54:45
问题 I have tried various links but I can\'t seem to find a good resource on creating a running solr instance that works with rails in production. I understand that you have to setup the solr server for production. I have tried the setup of solr with tomcat but I cant seem to link it to the rails app. Is there any good resource out there that I could use? Thanks 回答1: This blog may solve your question: Install Solr 4.4 with Jetty in CentOS, and set up Solr server to work with Sunspot Gem. ( http:/