Saturday, July 19, 2014

Vps config

install vim

  • # apt-get install libncurses5-dev python-dev
  • # wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 -O /data/vim-7.4.tar.bz2
  • # cd /data/ && tar jxf vim-7.4.tar.bz2
  • # cd vim74 && ./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config/ --enable-perlinterp --enable-cscope --enable-luainterp --enable-perlinterp --enable-multibyte
  • # make VIMRUNTIMEDIR=/usr/share/vim/vim74 && make install
  • # mkdir -p /usr/share/vim/vim74/ && rsync -avzcP --delete --exclude="dos" --exclude="spell" ftp.nluug.nl::Vim/runtime/ /usr/share/vim/vim74/

install vim plugin

  • # cd ~/.vim/bundle/YouCompleteMe
  • # git submodule update --init --recursive
  • # ./install.sh --clang-completer --system-libclang

install pcre

install zlib

  • # wget http://zlib.net/zlib-1.2.8.tar.gz -O /data/zlib-1.2.8.tar.gz
  • # cd /data/ && tar zxf /data/zlib-1.2.8.tar.gz
  • # cd zlib-1.2.8 && ./configure --prefix=/opt/zlib-1.2.8
  • # make && make install
  • # cd /opt && ln -s zlib-1.2.8 zlib

install cronolog

  • # wget http://cronolog.org/download/cronolog-1.6.2.tar.gz -O /data/cronolog-1.6.2.tar.gz
  • # cd /data && tar zxf /data/cronolog-1.6.2.tar.gz
  • # cd cronolog-1.6.2 && ./configure --prefix=/opt/cronolog-1.6.2
  • # make && make install
  • # cd /opt && ln -s cronolog-1.6.2 cronolog
  • # cd cronolog && mkdir pipes
  • # cd pipes && mkfifo blog_liuchao_me tech_liuchao_me www_liuchao_me
  • # nohup cat /opt/cronolog/pipes/tech_liuchao_me | /opt/cronolog/sbin/cronolog /var/log/nginx/tech.liuchao.me.access_%Y%m%d.log &
  • # nohup cat /opt/cronolog/pipes/blog_liuchao_me | /opt/cronolog/sbin/cronolog /var/log/nginx/blog.liuchao.me.access_%Y%m%d.log &
  • # nohup cat /opt/cronolog/pipes/www_liuchao_me | /opt/cronolog/sbin/cronolog /var/log/nginx/www.liuchao.me.access_%Y%m%d.log &

install nginx

  • # groupadd nginx && useradd nginx -g nginx
  • # wget http://nginx.org/download/nginx-1.6.0.tar.gz -O /data/nginx-1.6.0.tar.gz
  • # cd /data && tar zxf /data/nginx-1.6.0.tar.gz
  • # cd nginx-1.6.0 && ./configure --prefix=/opt/nginx-1.6.0 --user=nginx --group=nginx --with-poll_module --with-rtsig_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_stub_status_module --with-pcre=/data/pcre-8.35 --with-zlib=/data/zlib-1.2.8 --http-client-body-temp-path=/opt/nginx-1.6.0/tmp/client-body --http-proxy-temp-path=/opt/nginx-1.6.0/tmp/proxy --http-fastcgi-temp-path=/opt/nginx-1.6.0/tmp/fastcgi --http-uwsgi-temp-path=/opt/nginx-1.6.0/tmp/uwsgi --http-scgi-temp-path=/opt/nginx-1.6.0/tmp/scgi
  • # make && make install
  • # cd /opt && ln -s nginx-1.6.0 nginx
  • # mkdir -p /opt/nginx/tmp /var/log/nginx /opt/nginx/conf/server/ && chown -R nginx:nginx /var/log/nginx /opt/nginx /opt/nginx-1.6.0

install MySQL

  • # groupadd mysql && useradd mysql -g mysql
  • # apt-get install libncurses5-dev cmake bison
  • # wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.19.tar.gz -O /data/mysql-5.6.19.tar.gz
  • # cd /data/ && tar zxf /data/mysql-5.6.19.tar.gz
  • # mkdir -p /opt/mysql-5.6.19/tmp
  • # cd mysql-5.6.19 && cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql-5.6.19 -DMYSQL_DATADIR=/opt/mysql-5.6.19/data -DSYSCONFDIR=/opt/mysql-5.6.19/etc/ -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR=/opt/mysql-5.6.19/tmp/mysqld.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
  • # make install
  • # cd /opt && ln -s mysql-5.6.19 mysql
  • # cd mysql && ./scripts/mysql_install_db --user=mysql --datadir=/opt/mysql/data/
  • # chown -R mysql:mysql /opt/mysql /opt/mysql-5.6.19
  • # /opt/mysql/bin/mysqld_safe --defaults-file=/opt/mysql/my.cnf &

install PHP

  • # apt-get install libxml2-dev
  • # wget http://us1.php.net/get/php-5.5.14.tar.gz/from/this/mirror -O /data/php-5.5.14.tar.gz
  • # cd /data/ && tar zxf /data/php-5.5.14.tar.gz
  • # cd php-5.5.14 && ./configure --prefix=/opt/php-5.5.14 --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --enable-mbstring --with-mysql=/opt/mysql --with-mysql-sock=/opt/mysql/tmp/mysqld.sock --with-pear --with-zlib-dir=/opt/zlib --with-pcre-regex=/opt/pcre
  • # make && make install
  • # cd /opt/ && ln -s php-5.5.14 php

install Node.js

  • # apt-get install systemtap-sdt-dev libavahi-compat-libdnssd-dev
  • # wget http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz -O /data/node-0.10.29.tar.gz
  • # cd /data/ && tar zxf /data/node-0.10.29.tar.gz
  • # cd node-v0.10.29 && ./configure --prefix=/opt/node-0.10.29/ --with-dtrace --dest-cpu=x64 --dest-os=linux
  • # make && make intsall
  • # cd /opt && ln -s node-0.10.29 node
Link : https://github.com/liupangzi/vps-config/tree/master/lnmp