按提示输入
$ sudo passwd root 就是这么简单 前提是你进行更改的这个账户是管理员账户
将新加用户加入suoder组 sudo adduser mlzboy admin |
查看ubuntu版本号及别名
sudo lsb_release -a
Distributor ID: Ubuntu Description: Ubuntu 10.04.1 LTS Release: 10.04 Codename: lucid
使用国内源参考
http://www.vcbeta.net/read.php/455.htm
编辑vi ./source.list
deb http://mirrors.163.com/ubuntu/ lucid main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ lucid-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ lucid-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ lucid-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ lucid-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid-backports main restricted universe multiverse
sudo apt-get update
部署rails前置库,参考
http://www.cnblogs.com/lexus/archive/2010/12/10/1902646.html(主要)
http://www.cnblogs.com/lexus/archive/2010/12/10/1902047.html
安装rvm时注意
最后手工配置的部分
mlzboy@ubuntu:/etc/apt$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
109 986 109 986 0 0 509 0 0:00:01 0:00:01 --:--:-- 1117
Initialized empty Git repository in /home/mlzboy/.rvm/src/rvm/.git/
remote: Counting objects: 17167, done.
remote: Compressing objects: 100% (4603/4603), done.
remote: Total 17167 (delta 11567), reused 16582 (delta 11100)
Receiving objects: 100% (17167/17167), 3.01 MiB | 1.03 MiB/s, done.
Resolving deltas: 100% (11567/11567), done.
RVM: Shell scripts enabling management of multiple ruby environments.
RTFM: http://rvm.beginrescueend.com/
HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
Installing RVM to /home/mlzboy/.rvm/
Correct permissions for base binaries in /home/mlzboy/.rvm/bin...
Copying manpages into place.
Notes for Linux ( DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS" )
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
This is the *original* / standard Ruby Language Interpreter
'ree' represents Ruby Enterprise Edition
'rbx' represents Rubinius
bash >= 3.2 is required
curl is required
git is required (>= 1.7 recommended)
patch is required (for ree and some ruby-head's).
If you wish to install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.
If you wish to have the 'pretty colors' again,
set 'export rvm_pretty_print_flag=1' in ~/.rvmrc.
dependencies:
# For RVM
rvm: bash curl git
# For Ruby (MRI & ree) you should install the following OS dependencies:
ruby: /usr/bin/aptitude install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev
# For JRuby (if you wish to use it) you will need:
jruby: /usr/bin/aptitude install curl g++ openjdk-6-jre-headless
jruby-head: /usr/bin/aptitude install ant openjdk-6-jdk
# In addition to ruby: dependencies,
ruby-head: subversion
# For IronRuby (if you wish to use it) you will need:
ironruby: /usr/bin/aptitude install curl mono-2.0-devel
You must now complete the install by loading RVM in new shells.
1) Place the folowing line at the end of your shell's loading files
(.bashrc or .bash_profile for bash and .zshrc for zsh),
after all PATH/variable settings:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
You only need to add this line the first time you install rvm.
2) Ensure that there is no 'return' from inside the ~/.bashrc file,
otherwise rvm may be prevented from working properly.
This means that if you see something like:
'[ -z "$PS1" ] && return'
then you change this line to:
if [[ -n "$PS1" ]] ; then
# ... original content that was below the '&& return' line ...
fi # <= be sure to close the if at the end of the .bashrc.
# This is a good place to source rvm v v v
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
EOF - This marks the end of the .bashrc file
Be absolutely *sure* to REMOVE the '&& return'.
If you wish to DRY up your config you can 'source ~/.bashrc' at the bottom of your .bash_profile.
Placing all non-interactive (non login) items in the .bashrc,
including the 'source' line above and any environment settings.
3) CLOSE THIS SHELL and open a new one in order to use rvm.
WARNING: you have a 'return' statement in your ~/.bashrc
This could cause some features of RVM to not work.
This means that if you see something like:
'[ -z "$PS1" ] && return'
then you change this line to:
if [[ -n "$PS1" ]] ; then
# ... original content that was below the '&& return' line ...
fi # <= be sure to close the if at the end of the .bashrc.
# This is a good place to source rvm v v v
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
EOF - This marks the end of the .bashrc file
Even if you are using zsh you should still adjust the ~/.bashrc
If you have any questions about this please visit
#rvm on irc.freenode.net.
Installation of RVM to /home/mlzboy/.rvm/ is complete.
mlzboy,
Thank you very much for using RVM! I sincerely hope that RVM helps to
make your work both easier and more enjoyable.
If you have any questions, issues and/or ideas for improvement please
join#rvm on irc.freenode.net and let me know, note you must register
(http://bit.ly/5mGjlm) and identify (/msg nickserv <nick> <pass>) to
talk, this prevents spambots from ruining our day.
My irc nickname is 'wayneeseguin' and I hang out in #rvm typically
~09:00-17:00EDT and again from ~21:00EDT-~23:00EDT
If I do not respond right away, please hang around after asking your
question, I will respond as soon as I am back. It is best to talk in
#rvm itself as then other users can help out should I be offline.
Be sure to get head often as rvm development happens fast,
you can do this by running 'rvm get head' followed by 'rvm reload'
or opening a new shell
w⦿‿⦿t
~ Wayne
注意在原链接中用红色标记的部分为要改动的部分
另外执行完后使用source ~/.bashrc来重新加载变更
之后执行rvm notes来确认是否安装成功
在使用rvm install 1.9.2时出现一个问题
效果是一个带进度条的下载ruby的界面效果,如果长时间未动,说明是有问题了,要重新来过,参看下图的效果
使用上方面的方法还是不过关,原因是ruby官方的ftp到本国实在是太慢了到86%再也没速度了,于是我先在linode下将ruby-1.9.2-p136.tar.bz2下载好,
再将该文章用scp传到~/.rvm/archives/下
http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p136.tar.bz2
http://www.ruby-lang.org/en/news/2010/12/25/ruby-1-9-2-p136-is-released/
之后再运行rvm install 1.9.2就直接开始进行配置和编译了
这个过程还是很慢,一个cpu占用100%,难道是新的云主机cpu太弱了,据说是xen5620,我没看到实物,原先在linode的时候,好像不需要这样,在本机也没有这样的情况发生啊
设置1.9.2为默认,虽然只有一个版本
tmlzboy@ubuntu:~$ rvm list
rvm rubies
ruby-1.9.2-p136 [ i386 ]
mlzboy@ubuntu:~$ rvm use 1.9.2 --default
Using /home/mlzboy/.rvm/gems/ruby-1.9.2-p136
mlzboy@ubuntu:~$ rvm list
rvm rubies
=> ruby-1.9.2-p136 [ i386 ]
mlzboy@ubuntu:~$
在安装完rvm之后,可以使用cap deploy:setup来建立初始的目录了
这里由于之前linode中使用的是p0版本的ruby,这里使用的是p136版本的,因此在deploy.rb中需要进行一下变更
进入
cd /usr/local/nginx/conf
给conf目录以权限
sudo chmod -R 777 ./conf
备份nginx.conf
cp ./nginx.conf ./nginx.conf.bak.20110211
从linode下载原来的nginx.conf
scp mlzboy@boy38girl.com:/usr/local/nginx/conf/nginx.conf ./
由于ruby的版本从p0改为p136,因此要修改一下nginx.conf中的设置,改为
passenger_root /home/mlzboy/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2;
passenger_ruby /home/mlzboy/.rvm/wrappers/ruby-1.9.2-p136/ruby;
安装完mysql后
备份配置文件
cd /etc/mysql
sudo cp my.cnf ./my.cnf.bak.20110211
sudo rm my.cnf
从linode拷贝my.cnf过来
sudo scp mlzboy@boy38girl.com:/etc/mysql/my.cnf .
重启服务
sudo service mysql restart
二、Mysql数据库的修改注意后面得show databases;use mysql;
1) [root@etc etc]# mysql -u root -p
Enter password:
2)mysql>
3)mysql> select host,user,password from user;
4)grant all privileges on *.* to root@192.168.1.100 identified by 'password'grant all on *.* to root@'%' identified by '密码';
注意: (1)192.168.15.101是欲连接到此Mysql数据库的客户端的IP地址,而不是Mysql数据库所在数据库服务器的IP地址,切记
(2)password就是Mysql数据库root用户的password,根据实际情况需要修改安装memcachedsudo apt-get install libevent-dev wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz tar -zxvf ./memcached-1.4.5.tar.gz cd ./memcached-1.4.5启动memcached命令 memcached -d -l localhost 克隆远程仓库 mkdir git cd ~/git git clone --bare boy38girl.com:/home/mlzboy/git/b2c2.git 然后可以在本地找一个地方进行测试 git clone 115.236.18.xx:/home/mlzboy/git/b2c2.git
- ./configure
- make && make test
- sudo make install
进入到/home/mlzboy/b2c2/current下执行
这条命令似乎不能在byobu中执行,不知道是不是错觉
ar_sendmail_rails3 -d -e production --delay 2
以下部分参考
http://www.cnblogs.com/lexus/archive/2010/12/15/1907212.html
1.首先是要添加locale的支持
sudo locale-gen zh_CN.GBK sudo locale-gen zh_CN.GB2312 sudo locale-gen zh_CN.GB18030
2.更新一下locale:
sudo dpkg-reconfigure locales
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
2009-02-10 年后小结