Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 96 lines (72 sloc) 2.405 kB
echo "nameserver 8.8.8.8" > /etc/resolv.conf
useradd -m ubuntu
passwd ubuntu
visudo
ubuntu  ALL=(ALL) NOPASSWD: ALL
%admin ALL=(ALL) NOPASSWD: NOPASSWD: ALL
sudo usermod -G admin -a ubuntu #废弃
#关闭使用密码登陆
vi /etc/ssh/sshd_config
#在root和ubuntu用户目录下分别:
mkdir .ssh
vim .ssh/authorized_keys
export LC_ALL=C
sudo apt-get update
sudo apt-get install make zsh git-core ruby1.9.3 mysql-server libmysqlclient-dev
sudo gem install rails -v 3.2
#安装ZSH
curl -L http://install.ohmyz.sh | sh
#在root用户下切换zsh
chsh -s /bin/zsh linode
#安装Erlang
sudo apt-get install fop libncurses5-dev openjdk-6-jdk unixodbc-dev g++ libssl-dev
mkdir -p download
cd download && wget http://www.erlang.org/download/otp_src_R16B03-1.tar.gz
tar -xvf otp_src_R16B03-1.tar.gz && cd otp_src_R16B03-1
./configure && make all && sudo make install
#安装HTTP服务器
sudo gem install passenger --no-ri --no-rdoc
sudo passenger-install-nginx-module
安装目录: /usr/local/nginx
#安装REDIS
wget http://download.redis.io/releases/redis-2.8.17.tar.gz
tar xzf redis-2.8.17.tar.gz && cd redis-2.8.17 && make && make install
sudo mkdir /etc/redis && sudo cp redis.conf /etc/redis/
########################安装postfix########################
sudo apt-get install postfix mailutils
#postfix配置界面
选择 Internet Site
System mail name编辑界面直接回车
#编辑postfix配置文件
sudo vi /etc/postfix/main.cf
为destination 添加 xxx.com
设置smtpd_use_tls=no
#重启使配置生效
sudo /etc/init.d/postfix reload
#####################################################
#自动重启
sudo vim /etc/rc.local
#####################################################
sudo /usr/bin/service mysql start
sudo /usr/local/nginx/sbin/nginx
su - ubuntu -c "redis-server /etc/redis/redis.conf"
su - ubuntu -c "cd /home/ubuntu && god -c config.god"
#####################################################
#时区
sudo dpkg-reconfigure tzdata
#非常重要
vim /etc/default/rcS
UTC=no
sudo ntpdate ntp.ubuntu.com
date 检查时间
sudo hwclock --systohc
sudo vim /etc/security/limits.conf
ubuntu        -    nofile      1006154
sudo vim /etc/sysctl.conf
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 5000 65000
fs.file-max = 8061540
Jump to Line
Something went wrong with that request. Please try again.