- 浏览: 172215 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (174)
- rails (25)
- js (15)
- ruby (30)
- webserver (5)
- mysql (13)
- security (5)
- thinking (5)
- common sense (2)
- linux (18)
- android (26)
- web browser (1)
- config and deploy (1)
- mac (5)
- css (2)
- db (8)
- version manager (1)
- editor (1)
- job (1)
- OOA (1)
- php (1)
- apache (2)
- mongrel (1)
- Mongodb (1)
- facebook (1)
- 架构 (1)
- 高并发 (1)
- twitter (1)
- Erlang (1)
- Scala (1)
- Lua (1)
- ubuntu (3)
- cache (1)
- 面试题 (2)
- android layout (2)
- android控件属性 (2)
- java (5)
- customize view (1)
- advanced (2)
- python (2)
- 机器学习 (5)
最新评论
root帐号登录服务器
查看版本
cat /etc/issue
#CentOS release 5.2 (Final)
调整时区时间
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
sudo /usr/sbin/ntpdate us.pool.ntp.org
很简单吧,解析一下,第一句是把当前时区调整为上海就是+8区,想改其他时区也可以去看看/usr/share/zoneinfo目录;然后第二句 是利用ntpdate同步标准时间.
没有ntpdate的可以yum一下: yum install -y ntpdate
新建用户
useradd app
passwd app
#Changing password for user app.
#New UNIX password:
#Retype new UNIX password:
#passwd: all authentication tokens updated successfully.
#add app to sudoer
vi /etc/sudoers
#add line
app ALL=(ALL)NOPASSWD:ALL
#test
su app
sudo ls -all
配置自动登录
su app
cd /home/app/
mkdir .ssh
touch .ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
#回到本地机器
cd ~
#生成密钥对:
#ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub | ssh app@116.255.153.187 "cat - >> ~/.ssh/authorized_keys"
#test
ssh app@211.152.56.151
安装软件
iostat, sar等系统命令
sudo yum install sysstat
Git
sudo yum -y install zlib-devel
mkdir src
cd src
wget http://www.kernel.org/pub/software/scm/git/git-1.6.3.tar.gz
tar xf git-1.6.3.tar.gz
cd git-1.6.3
./configure --prefix=/usr/local/git <span class="Apple-style-span" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: rgb(0, 0, 0); font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; line-height: normal; white-space: normal; font-size: 13px; ">--without-tcltk </span>
make
sudo make install
cd /usr/bin/
sudo ln -ns /usr/local/git/bin/git
git --version
openssl(http://www.openssl.org/source)
cd
cd src
wget http://www.openssl.org/source/openssl-0.9.8i.tar.gz
tar zxvf openssl-0.9.8i.tar.gz
cd openssl-0.9.8i/
./config shared --prefix=/usr/local
make
sudo make install
cd ..
zlib(http://zlib.net/)
cd
cd src
wget http://www.zlib.net/zlib-1.2.5.tar.gz
tar zxvf zlib-1.2.5.tar.gz
cd zlib-1.2.5
CFLAGS="-O3 -fPIC" ./configure
make
sudo make install
cd ..<font class="Apple-style-span" face="Corbel, Verdana, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 16px; line-height: 25px; white-space: normal;"><b>
</b></span></font>
Redline(http://tiswww.case.edu/php/chet/readline/rltop.html)
cd
cd src
wget ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
tar zxvf readline-5.2.tar.gz
cd readline-5.2
./configure
make
sudo make install
cd ..
sudo /sbin/ldconfig
MySQL
#安装依赖 for error :http://webhostingneeds.com/Configure:_error:_No_curses_termcap_library_found
sudo yum -y install ncurses-devel
sudo /usr/sbin/groupadd mysql
sudo /usr/sbin/useradd -g mysql mysql
#version 5.1.48
cd
cd src
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.48.tar.gz/from/http://mysql.llarian.net/
tar xzf mysql-5.1.48.tar.gz
cd mysql-5.1.48
./configure --prefix=/usr/local/mysql --with-plugins=innobase
make
sudo make install
sudo cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
sudo bin/mysql_install_db --user=mysql
sudo chown -R root /usr/local/mysql
sudo chown -R mysql /usr/local/mysql/var
sudo chgrp -R mysql /usr/local/mysql
sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &amp;amp;
cd /usr/bin
sudo ln -s /usr/local/mysql/bin/mysql
#等待几秒
/usr/bin/mysqladmin -u root password 'new-password'
Ruby Enterprise Edition
cd
cd src
wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz
tar zxvf ruby-enterprise-1.8.7-2010.02.tar.gz
sudo ./ruby-enterprise-1.8.7-2010.02/installer
# [/opt/ruby-enterprise-1.8.7-2010.02] : /usr/local/ruby<font class="Apple-style-span" face="Corbel, Verdana, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 16px; line-height: 25px; white-space: normal;"></span></font>
<font class="Apple-style-span" face="Corbel, Verdana, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 14px; font-weight: normal; line-height: 21px; white-space: normal;">cd
vi .bash_profile
#add below line
PATH=$PATH:$HOME/bin:/usr/local/ruby/bin
. .bash_profile
ruby -v
gem -v</span></font>
<font class="Apple-style-span" face="Corbel, Verdana, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 14px; font-weight: normal; line-height: 21px; white-space: normal;">cd
cd src/ruby-enterprise-1.8.7-2010.02/source/ext/openssl
sudo ruby extconf.rb
make
sudo make install</span></font>
mysql gem
sudo gem install mysql -- --with-mysql-config='/usr/local/mysql/bin/mysql_config'
Openssl问题
sudo vi /etc/ld.so.conf
#加入下面一行
/usr/local/lib
#保存后
sudo /sbin/ldconfig
Nginx
sudo passenger-install-nginx-module
Please specify a prefix directory [/opt/nginx]: /usr/local/nginx<font class="Apple-style-span" face="Corbel, Verdana, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 16px; line-height: 25px; white-space: normal;"><b>
</b></span></font>
设置 .gemrc
cd
vi .gemrc
---
:bulk_threshold: 1000
:benchmark: false
:verbose: true
:sources:
- http://gemcutter.org
- http://gems.github.com
- http://gems.rubyforge.org/
:update_sources: true
:backtrace: false
gem: --no-ri --no-rdoc
设置Alias
cd ~
vi .bash_profile
#add below
alias vb='vi ~/.bash_profile;. ~/.bash_profile'
#grep
alias psg='ps axu|grep'
alias llg='ll -h |grep'
alias ll='ls -all --color'
alias n='sudo nano -w'
alias startmysql='sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &'
alias sql='mysql -uroot -pcp2010 --default-character-set=utf8'
#alias for monitor
alias mt='cd /home/www/monitor'
alias spd='cd /home/www/monitor/lib/spider/'
alias rsg='ruby signal_sender.rb'
alias alljob='ruby runner.rb -app_name=Fetch_all_data start -- -j all'
alias stopall='ruby runner.rb stop_all'
alias trunner='t output/runner'
alias texception='t output/exception'
#rails
alias sc='script/console'
alias ss='script/server'
alias ssp='script/server -p'
alias sg='script/generate'
alias spi='script/plugin install'
alias rdb='RAILS_ENV=production rake db:migrate'
alias rt='rake test'
alias pss="RAILS_ENV=production script/server"
alias psc="RAILS_ENV=production script/console"
alias tr='touch tmp/restart.txt'
# alias gp='git push origin master'
alias irbg='irb -rubygems'
alias gb='git branch'
alias gs='git status'
alias gc='git checkout'
alias gac='git add .;git commit'
alias gm='git merge'
alias gp='git push'
alias gl='git pull'
alias gi='~/bin/git-info.sh'
alias gw='git-instaweb -d webrick -p 8888'
alias gws='gw --stop'
#tail
alias t='tail -f -n 200'
#god
alias gods='god status'
alias grun='god start'
alias gstop='god stop'
# User specific aliases and functions<font class="Apple-style-span" face="Corbel, Verdana, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 16px; line-height: 25px; white-space: normal;"><b>
</b></span></font>
增加git info功能
cd
mkdir bin
vi bin/git-info.sh
------
#!/bin/bash
# author: Duane Johnson
# email: duane.johnson@gmail.com
# date: 2008 Jun 12
# license: MIT
#
# Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496
pushd . >/dev/null
# Find base of git directory
while [ ! -d .git ] && [ ! `pwd` = "/" ]; do cd ..; done
# Show various information about this git directory
if [ -d .git ]; then
echo "== Remote URL: `git remote -v`"
echo "== Remote Branches: "
git branch -r
echo
echo "== Local Branches:"
git branch
echo
echo "== Configuration (.git/config)"
cat .git/config
echo
echo "== Most Recent Commit"
git log --max-count=1
echo
echo "Type 'git log' for more commits, or 'git show' for full commit details."
else
echo "Not a git repository."
fi
popd >/dev/null
-------
#make execute
chmod +x bin/git-info.sh
发表评论
-
git命令
2015-06-06 15:05 763git命令: man git例如:工作目录下有个zh目录, ... -
搭建git服务器
2015-06-05 10:32 551原文:http://blog.chinaunix.net/ ... -
ubuntu下SVN服务器安装配置
2015-06-04 20:34 456一、SVN安装1.安装包$ sudo apt-get inst ... -
eth0 Device not found
2014-05-03 20:38 2595查看CPU信息(型号)# cat /proc/cpuinf ... -
webserver负载均衡
2012-03-29 16:11 846LVS是Linux Virtual Server的缩写,意思是 ... -
sed命令
2012-03-16 17:05 781------------------------------- ... -
安装apt应用
2012-03-16 16:07 704sudo apt-get install google-ch ... -
ubuntu下安装mongoDB
2011-09-08 00:05 1094ubuntu下安装mongoDB $ id sim ... -
重要概念
2011-07-21 20:04 694原文:http://bbs.chinaitlab.com/vi ... -
定时任务
2011-06-08 18:21 890crontab crontab log Redhat (R ... -
extract captcha image
2011-05-24 18:08 2619Decoding CAPTCHA's extract cap ... -
ubuntu file encoding
2011-05-24 18:02 927ubuntu file encoding sudo apt- ... -
config ssh auto login
2011-03-29 23:22 1226http://baike.baidu.com/view/161 ... -
linux commands
2011-03-19 18:04 785最基本的是cat、more和less。 1. ... -
Linux系统命令Top/free
2011-03-19 18:02 1052Defunct processes are corrupted ... -
vi基本命令
2011-03-19 17:40 982* ★命 ... -
mount命令挂载共享文件
2011-01-18 10:55 1687机器重启 网络共享功能失效 必须重新mount ...
相关推荐
主要介绍了在阿里云服务器上配置CentOS+Nginx+Python+Flask环境的教程,值得一提的是这里的方案用Nginx作反向代理而使用Gunicorn作wsgi服务器,需要的朋友可以参考下
EasyBCD配置CentOS教程
配置centos6源
VNC 配置 Centos7,此文档详细叙述了, CentOS配置VNC server的方法,以实现远程连接桌面
教程名称:Linux迅速入门玩转典型应用 多语言运行环境配置 CentOS系统 VIM操作技巧 SSH运维教程内容: 无论你是学习的哪种语言,并且大数据、人工智能大时代的到来,Linux重要性不可言说。课程基于CentOS系统为标准...
VMware 配置centos固定ip并上网VMware 配置centos固定ip并上网VMware 配置centos固定ip并上网
编译PHP5配置centos6.4
https原理与配置 centos
EasyBCD配置CentOS配置文档,非常好用,简单快捷没毛病
安装和配置CentOs.one
RedHatEnterprise6.4配置CentOS6.4软件源借鉴.pdf
1_利用VMware10安装并配置CentOS-6.5-x86_64-bin-DVD1.pdf
centos9_StreamISO镜像及yum源配置文件和配置方法
解决CentOS7虚拟机无法上网并设置CentOS7虚拟机使用静态IP上网
安装centos7的时候注意选择两个网卡(配置CentOS7虚拟机里面能上外网,而主机与CentOS7虚拟机也能连通) 两个网卡分别为: nat(虚拟机访问互联网,使用10.0.2.x段) host-only(虚拟机和主机互相通信,使用192.168.56....
具体的区别网上的资料很多,就不再描述了,下面是一个最直接有效的配置,配置CentOS7虚拟机里面能上外网,而主机与CentOS7虚拟机也能连通。不论是学习还是使用,基本都能够满足。不废话,直接上图! 设置Virtual
centos6.4系统环境下的nagios监控配置
PHP运行环境配置(Centos 64位 PHP5.4 Nginx)
Windows7配置PuTTY+Xming连接CentOS7 SSH服务器图形化界面.........
centos实用配置整理,共14篇. 包括:1 安装 2 初始配置 3 ssh 4 数据完整性监测系统 5 入侵检测以及病毒查杀 6 动态域名 7 Apache之安装 8 安全https 9 apache相关配置 10 MySQL安装 11 ProFTPD 12 Samba 13 Postfix ...