我刚刚build立了一台运行Ubuntu Server的虚拟机,安装了LAMP堆栈和OpenSSH。 现在什么是使服务器运行rails和PHP应用程序的最佳方式? 最好是虚拟化主机服务器上的两台服务器吗? – 或者他们可以快乐地一起跑? Mongrel会成为Rails服务器的最佳select吗?
我有一个非常简单的Ruby应用程序,它使用Thin和Bundler,我需要把它粘在一个Ubuntu盒子上。 我已经尽可能在服务器上安装Ruby,Bundler等,但是在运行应用程序本身时遇到了麻烦。 本质上,我需要一个很好的方式,通过capistrano启动,停止和重新启动应用程序。 我的init.d脚本看起来很像这样: DAEMON=/home/ubuntu/apps/my_app/shared/bundle/ruby/1.8/bin/thin SCRIPT_NAME=/etc/init.d/thin CONFIG_PATH=/etc/thin # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 case "$1" in start) cd /home/ubuntu/apps/my_app/current && bundle exec thin start -d -C /etc/thin/my_app.yml ;; stop) cd /home/ubuntu/apps/my_app/current && bundle exec thin stop -d -C /etc/thin/my_app.yml ;; restart) cd /home/ubuntu/apps/my_app/current && bundle exec […]
我已经从puppetlabs的.dmg中安装了puppet 3.0.1。 如果我删除ruby1.9.3,木偶工作,但其他像我的vim安装(依赖插件)不。 根据http://docs.puppetlabs.com/guides/platforms.html#ruby-versions 1.9.3的支持。 那么傀儡怎么了? % uname -a Darwin Kusanagi.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64 % which ruby /usr/local/bin/ruby % ruby –version ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin11.4.2] % /usr/bin/ruby –version ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0] % brew info ruby 1 ↵ ruby: stable 1.9.3-p327, […]
我试图debugging为什么我的服务器有3秒延迟每个请求。 这些是我的nginx和独angular兽configuration文件: https : //gist.github.com/regedarek/de7f2e5cd1918b6224ac 我的服务器信息: Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-37-generic x86_64) System load: 0.02 Processes: 71 Usage of /: 38.9% of 6.89GB Users logged in: 0 Memory usage: 28% IP address for eth0: 149.156.119.151 Swap usage: 0% server:~$ cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : […]
使用Rails 4和Ruby 2.0,是否需要安装Phusion Passenger? 这是我的理解,Passenger的目的是pipe理Ruby 2之前存在的内存泄漏。如果这不是Phusion Passenger的目的,请详细说明!
我试图通过暴发户启动gitlab sidekiq守护进程。 但不幸的是,sidekiq工人似乎是从sidekiq开始deamonizes自己respawned: Jul 12 17:26:42 git kernel: [370722.042968] init: gitlab-sidekiq main process (28251) terminated with status 1 Jul 12 17:26:42 git kernel: [370722.042997] init: gitlab-sidekiq main process ended, respawning 有没有一种方法来“掠夺”一个耙子任务? (我知道这个和这个 )或者专门运行gitlab sidekiq作为暴发户脚本。 这是我目前的工作: description "Sidekiq Background Worker for Gitlab" # no "start on", we don't want to automatically start start on runlevel [2345] […]
在这个厨师食谱的部分,有4个execute资源。 他们应该只在文件不存在时运行。 这是作为条件添加到第一个资源,然后触发整个链运行。 # Set up default SSL cert execute "defaultcert1" do not_if {File.exist?("/vol/webserver/cert")} command "mkdir /vol/webserver/cert" notifies :run, "execute[defaultcert2]", :immediately end execute "defaultcert2" do action :nothing command "ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /vol/webserver/cert/server.crt" notifies :run, "execute[defaultcert3]", :immediately end execute "defaultcert3" do action :nothing command "ln -s /etc/ssl/private/ssl-cert-snakeoil.key /vol/webserver/cert/server.key" notifies :run, "execute[defaultcert4]", :immediately end execute "defaultcert4" do […]
我已经检查了一些类似的问题在stackoverflow,但还没有find答案。 我正在尝试从源代码构buildRuby: https : //www.ruby-lang.org/en/installation/#building-from-source 在这里,我得到: ubuntu@saucy1:~/ruby-2.1.1$ ./configure checking build system type… x86_64-unknown-linux-gnu checking host system type… x86_64-unknown-linux-gnu checking target system type… x86_64-unknown-linux-gnu checking for gcc… gcc checking whether the C compiler works… no configure: error: in `/home/ubuntu/ruby-2.1.1': configure: error: C compiler cannot create executables See `config.log' for more details 更新: 该系统是全新的,我使用的是Ubuntu 13.10的云映像,从http://uec-images.ubuntu.com/saucy/current/saucy-server-cloudimg-amd64-disk1.img下载 我用开放的堆栈软件制作了这个云虚拟机。 我通过这个命令安装了gcc: […]
我需要编写一些脚本来更改Apache conf文件,即添加/更新VirtualHosts。 我打算在Ruby中这样做。 在写我自己的之前,是否有任何脚本/ rubygems允许Rubyparsing/修改Apache conf文件,特别是<VirtualHost>指令?
我尝试运行一些用Ruby编写的Munin插件。 我想使用RVM,所以Munin需要知道在哪里可以findRuby。 我试图改变在cron文件中调用munin-cron的行,如下所示: */5 * * * * munin bash -c 'source /usr/local/lib/rvm && rvm 1.9.2@munin && /usr/bin/munin-cron' 这导致在munin-node.log中的错误消息,说 /usr/bin/env: ruby: No such file or directory 当我将插件的版本更改为Ruby可执行文件的实际path时,它的工作原理是,应该设置RVM环境以便'/ usr / bin / env ruby'工作。 当我以root身份执行插件时,它会执行。 有任何想法吗? 更新1 由于Munin似乎在执行插件时重置了环境,我试图将插件的shebangs设置为RVM包装器脚本, rvm wrapper 1.9.2@munin munin 现在我在variables名上得到了几个“command not found”错误,这意味着插件现在由shell而不是Ruby来解释。 更新2 复制包装脚本而不是符号链接rvm创build并添加 source /usr/local/lib/rvm 也没有帮助。