Ubuntu 12.04.4 LTS 部署cap 二

创建gemset

[email protected]:~$ rvm gemset list

gemsets for ruby-1.9.3-p547 (found in /home/apps/.rvm/gems/ruby-1.9.3-p547)

=> (default)

global

[email protected]:~$ rvm gemset create xmnewcrm

ruby-1.9.3-p547 - #gemset created /home/apps/.rvm/gems/[email protected]

ruby-1.9.3-p547 - #generating xmnewcrm wrappers........

[email protected]:~$ rvm gemset list

gemsets for ruby-1.9.3-p547 (found in /home/apps/.rvm/gems/ruby-1.9.3-p547)

=> (default)

global

xmnewcrm

[email protected]:~$ ruby -v

ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-linux]

部署

[email protected]:~/xmnewcrm$ cap production deploy

在被部署的节点服务器上

[email protected]:~$ ll /app/rails/xmnewcrm.xiaoma.com/shared/

total 16

drwxrwxr-x 4 apps apps 4096 Aug 29 13:26 ./

drwxr-xr-x 5 apps apps 4096 Aug 29 13:21 ../

drwxrwxr-x 2 apps apps 4096 Aug 29 13:29 bin/

drwxrwxr-x 3 apps apps 4096 Aug 29 13:24 bundle/

[email protected]:~$ mkdir /app/rails/xmnewcrm.xiaoma.com/shared/config

[email protected]:~$ mkdir /app/rails/xmnewcrm.xiaoma.com/shared/tmp

[email protected]:~$ mkdir /app/rails/xmnewcrm.xiaoma.com/shared/log

[email protected]:~$ mkdir /app/rails/xmnewcrm.xiaoma.com/shared/public

[email protected]:~$ vim /app/rails/xmnewcrm.xiaoma.com/shared/config/database.yml

# SQLite version 3.x

#   gem install sqlite3

#

#   Ensure the SQLite 3 gem is defined in your Gemfile

#   gem ‘sqlite3‘

development:

adapter: mysql

database: xmnewcrm

username: root

password: ergal1234

encoding: utf8

#pool: 5

#timeout: 5000

# Warning: The database defined as "test" will be erased and

# re-generated from your development database when you run "rake".

# Do not set this db to the same as development or production.

test:

adapter: sqlite3

database: db/test.sqlite3

pool: 5

timeout: 5000

production:

adapter: mysql2

database: xmnewcrm

username: root

password: ergal1234

encoding: utf8

staging:

adapter: mysql2

encoding: utf8

database: xmnewcrm

pool: 5

host: localhost

username: root

password: ergal1234

创建项目的数据库

[email protected]:~$ mysql -uroot -pergal1234

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 36

Server version: 5.5.35-0ubuntu0.12.04.2 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> create database xmnewcrm;

Query OK, 1 row affected (0.01 sec)

部署

[email protected]:~/xmnewcrm$ cap production deploy

启动

[email protected]:~/xmnewcrm$ cap production deploy:start

cap staging deploy

218  cap staging deploy:start_ps

219  cap staging deploy:stop_ps

220  cap production deploy:start

11  mkdir /app/rails/xmnewcrm.xiaoma.com/

12  ruby -v

13  rvm -v

14  ll .ssh/

15  cat .ssh/id_dsa.pub

16  ssh [email protected]

17  ruby -v

18  rvm -v

19  ll .ssh/

20  ll

21  \curl -sSL https://get.rvm.io | bash -s stable

22  ll

23  rvm -v

24  ruby -v

25  rvm install 1.9.3

26  source /home/apps/.rvm/scripts/rvm

27  ruby -v

28  rvm -v

29  rvm install 1.9.3

30  echo $?

31  ssh [email protected]

32  ll

33  ls

34  id apps

35  git clone [email protected]:xmnewcrm

36  cat .ssh/id_dsa.pub

37  git clone [email protected]:xmnewcrm

38  ll

39  rvm gemset list

40  rvm gemset create xmnewcrm

41  rvm gemset list

42  ruby -v

43  mysql -uroot -pergal1234

44  lsof -i:3306

45  ll /app/rails/xmnewcrm.xiaoma.com/

46  ll /app/rails/xmnewcrm.xiaoma.com/shared/

47  mkdir /app/rails/xmnewcrm.xiaoma.com/shared/config

48*

49  vim /app/rails/xmnewcrm.xiaoma.com/shared/config/database.yml

50  ll /app/rails/xmnewcrm.xiaoma.com/shared/

51  ll /app/rails/xmnewcrm.xiaoma.com/shared/config/

52  ll /app/rails/xmnewcrm.xiaoma.com/shared

53  ps aux|grep un

54  ll /app/rails/xmnewcrm.xiaoma.com/shared

55  mkdir /app/rails/xmnewcrm.xiaoma.com/shared/

56  ll /app/rails/xmnewcrm.xiaoma.com/shared

57  mkdir /app/rails/xmnewcrm.xiaoma.com/shared/log

58  mkdir /app/rails/xmnewcrm.xiaoma.com/shared/public

59  ll /app/rails/xmnewcrm.xiaoma.com/shared

60  ll /app/rails/xmnewcrm.xiaoma.com/shared/log/

61  ll /app/rails/xmnewcrm.xiaoma.com/shared/public/

62  ll /app/rails/xmnewcrm.xiaoma.com/shared/log/

63  ll /app/rails/xmnewcrm.xiaoma.com/shared

64  ll /app/rails/xmnewcrm.xiaoma.com

65  ll

66  ls

67  rails s -p 8000

68  ls

69  ll

70  cd /app/rails/xmnewcrm.xiaoma.com/

71  rails s -p 8000

72  ruby -v

73  rails -v

74  gemlist

75  rails c

76  rails

77  cd /app/rails/xmnewcrm.xiaoma.com/

78  ll

79  cd shared/

80  ll

81  ll public/

82  ll log/

83  ll public/

84  cd ~

85* ll /app/rails/xmnewcrm.xiaoma.com/shared/tmp/unicorn.sock

86  history

时间: 2024-11-10 11:02:24

Ubuntu 12.04.4 LTS 部署cap 二的相关文章

Ubuntu 12.04.4 LTS 部署cap

一.系统环境 [email protected]:~$ cat /etc/issue Ubuntu 12.04.4 LTS \n \l [email protected]:~$ uname -ra Linux mode 3.11.0-15-generic#25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux 二.创建用户 [email protected]:~$ sudo adduse

Ubuntu 12.04 Server LTS下安装桌面及vncserver

亲测通过 1. 安装相关的包: apt-getupdate apt-get install ubuntu-desktop apt-getinstall vnc4server apt-get install x-window-system-core apt-get install gdm apt-get install gnome-panel 2. 设置vncserver Vncpasswd 以root身份chmod +x/etc/X11/xinit/xinitrc Vi /root/.vnc/x

U盘安装 Ubuntu 12.04 Server LTS

折腾了半天12.04 server版,遇到的问题,貌似难度比10.04大很多: 首先是低版本的ultraISO不支持12.04映像刻录,只显示出EFI, 所以只能下个高版本的9.5.5(UUI被证明是不可行的) 其次是按照10.04来做的话,Help->F6根本没有地方输入installcdrom-detect/try-usb=true.(找了好久,实在是找不到,网上没有找到的...好吧,其实就是没有) 经过各种折腾,在网上看到一个很有价值的文章,终于试成功了一个办法: 1. 用UltraISO

ubuntu的一些常用命令,测试版本:Ubuntu 12.04.5 LTS

最近配置了一台Linux服务器,选用的是Ubuntu 12.04.5 LTS版本. 把之前放在Windows Server 2003上的网站移到了现在的服务器上,给我的感受用一个字形容:真JB快! 网页瞬间打开,几乎无迟钝!虽然配置上面相比Windows Server 2003要复杂一些,但是看到网站打开那么快, 这点又算什么~ 好了,下面我要把一些常用命令和配置过程中遇到的问题记录下来,方便自己以后查找, (好记性不如烂笔头) 如果有幸能帮到你,那就功德圆满了~ 以下所有命令全部在 Ubunt

Ubuntu 12.04.5 LTS 安装openvpn

帮助网址:http://www.xiaohui.com/dev/server/20070514-install-openvpn.htm 生成证书 cd /etc/openvpn/easy-rsa/2.0/ ll . vars ./pkitool zonglizhu cd keys/ ll tar cvzf zonglizhu.tar.gz ca.crt zonglizhu* 把证书拷贝到本地 sz zonglizhu.tar.gz 让windows 客户端连接到 Ubuntu 12.04.5 L

ubantu下配置android开发环境(Ubuntu 12.04.4 LTS x64 dell 3420)

鉴于每次重装系统都要重新安装软件,重新配置选项,而ubantu下的安装步骤往往比较麻烦,在此将具体的操作步骤记录下来,以便于后来的查看,从而省去重新查找安装步骤的麻烦. 1.Android SDK中的adb程序是32位的,Ubuntu x64系统需要安装32位库文件,用于兼容32位的程序.我的系统是64位的,如果不安装,adb会出错:java.io.IOException: error=2 sudo apt-get install -y libc6-i386 lib32stdc++6 lib32

CentOS release 6.4 (Final) KVM上安装Ubuntu 12.04.4 LTS

Ubuntu 12.04.1 LTS 升级 PHP 从5.3 到 5.5

#!/bin/bash # desc install php5.5 #add-apt-repository ppa:ondrej/php5 #apt-get install python-software-properties #apt-get update #apt-get install php5 #php5 -v apt-get install python-software-properties apt-get install -y ppa-purge add-apt-repositor

Ubuntu 12.04 安装 gearman 以及php扩展安装脚本

#!/usr/bash #create by lhb #date 2014-05-07 #desc install gearman and php extension for Ubuntu 12.04.4 LTS PHP 5.5 apt-get update #安装依赖库 apt-get install libboost-all-dev gperf libevent1-dev libcloog-ppl0 mkdir -pv /home/lhb/software && cd /home/lh