安裝lnmprm的shell,臨時

隨便寫寫,省了新裝的一大堆步驟,待完善

centos 6.6

php nginx mysql redis mongodb

#!/bin/bash
yum install wget -y


echo "##########install remi repo##########"
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
rm -rf epel-release-6-8.noarch.rpm
rm -rf remi-release-6.rpm


echo "##########install nginx##########"
echo "[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/
gpgcheck=0
enabled=1
priority=1" > /etc/yum.repos.d/nginx.repo


echo "##########install mongodb repo##########"
echo "[mongodb-org-3.0]
name=MongoDB Repository
baseurl=http://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1" > /etc/yum.repos.d/mongodb-org-3.0.repo


yum install --enablerepo=remi ntpdate vim nginx lrzsz gcc pcre-devel zlib-devel openssl openssl-devel mysql mysql-server php php-devel php-gd php-fpm php-mysql php-mbstring php-xml php-mcrypt zip unzip mongodb-org php-pear samba -y


yum update --enablerepo=remi -y


echo "
extension=mongo.so" >> /etc/php.ini


pecl install mongo


chkconfig --level 2345 php-fpm on
chkconfig --level 2345  nginx on
chkconfig --level 2345  mongod on
chkconfig --level 2345  mysqld on


service php-fpm start
service nginx start
service mongod start
service mysqld start

#修改
#mysql_secure_installation
#/etc/nginx/conf.d/default.conf
#/etc/php-fpm.d/www.conf 用戶和組 php_flag[display_errors] = on
#關閉selinux /etc/selinux/config SELINUX=disabled
#wget http://download.redis.io/releases/redis-3.0.0.tar.gz
#修改/etc/php.ini data.timezone = Asia/Shanghai
#重啓
</pre><pre name="code" class="plain">騰訊雲NTP */20 * * * * /usr/sbin/ntpdate ntpupdate.tencentyun.com >/dev/null &
cn.ntp.org.cn

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章