Skip to content

Instantly share code, notes, and snippets.

@tqyq
Created October 15, 2015 06:30
Show Gist options
  • Save tqyq/06a421b87669cfd97a72 to your computer and use it in GitHub Desktop.
Save tqyq/06a421b87669cfd97a72 to your computer and use it in GitHub Desktop.
centos install nginx php mongo
=============================
tools
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install -y lrzsz nmap subversion rsync mlocate flex byacc libpcap ncurses ncurses-devel libpcap-devel lsof openssl-devel
yum -y groupinstall "Development Tools"
wget -c http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz
yum install -y httpd-tools
=============================
nginx
vi /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
yum install -y nginx
service nginx start
chkconfig nginx on
=============================
php
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
yum install -y yum-priorities
vi /etc/yum.repos.d/remi.repo
[remi]
name=Les RPM de remi pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=1
priority=10
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority
#default php version
yum install php-pear php-fpm php-cli php-mongo php-apc php-devel php-gd php-mysql php-mbstring php-redis
#install/upgrade to php 5.5
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum remove php-common
yum install php55w php55w-opcache php55w-common php55w-cli php55w-fpm php55w-pear php55w-devel php55w-mbstring php55w-mcrypt php55w-gd php55w-mysql
pecl install mongo
pecl install redis
vi /etc/php-fpm.d/www.conf
user = apache
group = apache
service php-fpm start
chkconfig php-fpm on
#hhvm --mode server -vServer.Port=9900 -vServer.Type=fastcgi &
=============================
mongodb
vi /etc/yum.repos.d/mongodb.repo
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1
yum install -y mongo-10gen mongo-10gen-server
vi /etc/mongod.conf
#change db/log dir to /data/mongo
dbpath=/data/mongo
chown -R mongod /data/log/mongodb /data/mongo
service mongod start
chkconfig mongod on
=============================
ffmpeg
vi /etc/yum.repos.d/dag.repo
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt
yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm
yum install -y ffmpeg ffmpeg-devel mencoder mplayer flvtool2 lame ffmpeg-php
=============================
zend guard loader
wget -c http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz
tar -zxf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz
cd ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64
cp php-5.4.x/ZendGuardLoader.so /usr/lib64/php/modules/
vi /etc/php.d/ZendGuard.ini
zend_extension=/usr/lib64/php/modules/ZendGuardLoader.so
zend_loader.enable=1
service php-fpm restart
php -i|grep Zend
=============================
机器A(192.168.1.155),B(192.168.1.181)。现想A通过ssh免密码登录到B。
1.在A机下生成公钥/私钥对。
ssh-keygen -t rsa -P ''
2.B机需要有.ssh目录。
ssh root@B "mkdir ~/.ssh"
3.把A机下的id_rsa.pub复制到B机的.ssh/authorized_keys文件里。
cat ~/.ssh/id_rsa.pub | ssh root@B "cat >> .ssh/authorized_keys"
4.
ssh root@B "chmod 600 .ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment