Linux setup cory

linunx version
CentOS release 6.7 (64)

add user
[root@AY13111514211915241fZ /]# useradd -m appdev [root@AY13111514211915241fZ /]# passwd appdev

add sudo previlege
shell> su shell> chmod +w /etc/sudoers shell> echo '${username} ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers shell> chmod -w /etc/sudoers shell> exit

set screen config
defscrollback 8000 hardstatus alwayslastline "%Lw" hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
 * specify screen config on file ~/.screenrc
 * 1) set this up for convenience

stop default apache
[root@cory ~]# whereis apachectl apachectl: /usr/sbin/apachectl /usr/share/man/man8/apachectl.8.gz [root@cory ~]# /usr/sbin/apachectl stop

install git
shell>sudo yum install git

install subversion
shell>sudo yum install subversion

install nodejs
$ cd Downloads/ $ wget https://nodejs.org/dist/v4.3.1/node-v4.3.1-linux-x64.tar.xz. $ tar Jxvf node-v4.3.1-linux-x64.tar.xz cd /usr/local/ sudo mv ~/Downloads/node-v4.3.1-linux-x64 node-v4.3.1 sudo chown -R root:root node-v4.3.1 sudo ln -s node-v4.3.1 nodejs cd /usr/local/bin/ sudo ln -s /usr/local/nodejs/bin/node node sudo ln -s /usr/local/nodejs/bin/npm npm

add sudo $PATH
>sudo visudo >Defaults   secure_path =+ /usr/local/bin

install nvm

 * https://github.com/creationix/nvm
 * https://github.com/creationix/nvm/issues/43

install ghost blog
$ curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip $ unzip -uo ghost.zip -d ghost $ cd /path/to/ghost npm install --production $ npm start


 * You can adjust the IP-address and port in config.js

通过 npm install forever -g 安装 forever NODE_ENV=production forever start index.js 通过 forever stop index.js 停止 Ghost 通过 forever list 检查 Ghost 当前是否正在运行
 * Use forever run ghost in background


 * http://docs.ghost.org/installation/linux/
 * http://docs.ghost.org/zh/installation/deploy/

install gcc
>sudo yum install gcc

install apache and php
>wget http://mirrors.gigenet.com/apache//httpd/httpd-2.2.31.tar.gz. >wget http://php.net/distributions/php-5.6.18.tar.gz.


 * http://lokvin.wikia.com/wiki/Mac#install_apache_with_php

install memcached
shell>sudo yum install memcached

shell>sudo /etc/init.d/memcached start
 * start memcached

shell>
 * memcached config