安装vim
, ctags
, postgresql
, lnmp
, setuptools
, sqlite3
, ruby
, rubygems
, mysql-python
,ruby-mysql
, git
<!-- lang: shell -->
apt-get update
apt-get upgrade
apt-get install vim ctags sqlite3 libsqlite3-dev git python-dev libxslt1-dev
apt-get install postgresql ruby ruby-dev rubygems
mkdir down
cd down
wget http:
python ez_setup.py
wget http:
tar zxvf lnmp1.1-full.tar.gz
cd lnmp1.1-full
# 替换 vhost.sh 中所有的 wwwroot 为 www。让新建的站点默认的根目录在 /home/www 下
vi vhost.sh
./debian.sh
./eaccelerator.sh
./ionCube.sh
./imageMagick.sh
# 解决 mysql_config not found 问题
ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config
# 解决 memcached 找不到目录的问题
mkdir -p /var/lock/subsys
./memcached.sh
安装 python
相关的库
easy_install pip
pip install virtualenv virtualenvwrapper vim_debug
配置 .bashrc
, ssh
, vim
, git
,
配置 .bashrc
,修改成
<!-- lang: shell -->
alias ls='ls -h --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias la='ls -AF'
alias ll='ls -lF'
alias l='ls -CF'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
export GREP_OPTIONS="--exclude-dir=\.svn"
export VIRTUALENV_USE_DISTRIBUTE=1
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
配置 ssh
请看另一篇博文《禁止 root 直接登录 sshd》
配置 vim
clone github 已经配置好的。
已配置的相关插件:
-
YouCompleteMe
-
NERD_commenter
-
NERD_tree
-
TagBar
-
txtbrowser
-
solarized - 主题
-
markdown
-
emmet
-
vim-powerline
下载配置
<!-- lang: shell -->
cd
git clone https://github.com/fxiao/vimrc-linux_osx.git .vim
mkdir ~/.vim/bundle
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
ln -s .vim/vimrc ./.vimrc
vim +PluginInstall +qall
cd ~/.vim/bundle/YouCompleteMe
git submodule update --init --recursive
./install.sh
配置 git
配置 git 的基本信息和命令缩写
vi .gitconfig
写入
<!-- lang: shell-->
[user]
name = fxiao
email = heyun51@gmail.com
[core]
excludesfile = /root/.gitignore_global
editor = vim
[alias]
co = checkout
ci = commit
st = status
ca = commit -a
b = branch
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset - %C(yellow)%cn%Creset' --abbrev-commit --date=relative
[diff]
tool = vimdiff
[difftool]
prompt = No
[merge]
tool = vimdiff
配置 git 忽略文件规则
vi .gitignore_global
写入
<!-- lang: shell -->
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.log
*.sqlite
.DS_Store*
ehthumbs.db
._*
.Spotlight-V100
.Trashes
Icon?
Thumbs.db
.svn
*.bak
ehthumbs.db
Runtime
*.swp
tags
配置 IP 和 DNS
IP,把 /etc/network/interfaces 修改成
<!-- lang: shell -->
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.23
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1
DNS,把 /etc/resolv.conf 修改成
nameserver 192.168.1.1
之后运行 reboot 重启电脑