更新yum库:yum updat yum install epel-release

yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel

查看是否安装mysql:rpm -qa|grep -i mysql

移除列表mysql :yum remove mysql-5.1.73-7.el6.x86_64 && yum remove mysql-libs-5.1.73-7.el6.x86_64

查看centos:cat /etc/issue

安装mysql:yum install mysql-server

启动mysql:service mysqld start

修改mysql密码:mysqladmin -u root password 123456

安装 rz sz命令 :yum install lrzsz -y

执行导入sql语句:mysql -uroot -p123456 ttt<gd.ttt.com20161010.sql

安装nginx:rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

yum install nginx

安装redis:yum install redis

安装php:

wget http://cn2.php.net/distributions/php-7.1.2.tar.gz

tar -zxvf php-7.1.2.tar.gz

yum install gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel libpng-devel

./configure \
--prefix=/usr/local/php71 \
--with-config-file-path=/usr/local/php71/etc \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-fpm \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-freetype-dir=/usr/local/freetype \
--with-gettext \
--enable-mbstring \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-openssl \
--enable-bcmath \
--enable-soap \
--with-libxml-dir \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-curl \
--with-zlib \
--enable-zip \
--with-bz2 \
--with-gd \
--with-readline \
--enable-opcache

make -j8

make install

cp php.ini-development /usr/local/php71/etc/php.ini
cp /usr/local/php71/etc/php-fpm.conf.default /usr/local/php71/etc/php-fpm.conf
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-php71
chmod +x /etc/init.d/php-php71
service php-php71 start

/usr/local/php71/bin/pecl install redis-2.2.8

vi /usr/local/php71/etc/php.ini + extension=redis.so

vi ~/.bash_profile

PATH=$PATH:$HOME/bin
改为:
PATH=$PATH:$HOME/bin:/usr/local/php71/bin

source ~/.bash_profile

开机启动:

nginx: chkconfig --add nginx && chkconfig --level 35 nginx on

mysqld: chkconfig --add mysqld && chkconfig --level 35 mysqld on

php:chkconfig --add php-php71 && chkconfig --level 35 php-php71 on

redis:chkconfig --add redis && chkconfig --level 35 redis on

查看SELinux状态:

1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态

SELinux status: enabled

2、getenforce ##也可以用这个命令检查

关闭SELinux:

1、临时关闭(不用重启机器):

setenforce 0 ##设置SELinux 成为permissive模式

##setenforce 1 设置SELinux 成为enforcing模式

2、修改配置文件需要重启机器:

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可

删除开启启动项:

1.编辑 /etc/inittab
2./etc/rc.d/rc3.d 或 /etc/rc.d/rc5.d (根据inittab里的initdefault不同)下的连接
可以用chkconfig --list 查看,主要是3:on 或 5:on
chkconfig servicename off #关闭
chkconfig servicename on #打开
3.编辑 /etc/rc.d/rc.local

chkconfig --del php-php71

增加开机 启动sh脚本 vi /etc/rc.d/rc.local

http://blog.chinaunix.net/uid-25266990-id-2747211.html

05-11 09:02