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

Related Posts:

  • Hướng dẫn Chmod an toàn cho website DigiStar đề nghị CHMOD như sau để bảo vệ an toàn cho website tại host của DigiStar: 1) CHMOD thư mục Public_html thành 710 thay vì mặc định là 750 việc này sẽ giúp bạn bảo… Read More
  • Giám sát hệ thống Linux với netstat Netstat là một công cụ hữu ích của Linux cho phép bạn kiểm tra những dịch vào nào đang kết nối đến hệ thống của bạn. Nó rất hữu ích trong việc phân tích cái gì đang xảy ra trên hệ thống của bạn khi bạn cố gắng ngăn chặn một … Read More
  • What are the best linux permissions to use for websiteQuestion: I have a Linux web server running Apache2 that hosts several websites. Each website has its own folder in /var/www/. /var/www/contoso.com/ /var/www/contoso.net/ /var/www/fabrikam.com/ The base directory /var/www/… Read More
  • .htaccess rewrite tips .htaccess rewrite tips #1 12-08-2013, 02:52 AM Be aware that mod_rewrite (RewriteRule, RewriteBase, and RewriteCond) code is executed for each and every HTTP request that accesses a file in or below the directory where t… Read More
  • Sticky Bit What is Sticky Bit? Sticky Bit is mainly used on folders in order to avoid deletion of a folder and its content by other users though they having write permissions on the folder contents. If Sticky bit is enabled on a fol… Read More