CentOS 6 Kangle+PHP+MySQL服务器安装脚本

kangle是一个性能很高的Web服务器,仅次于Nginx和Apache(个人评价),安装简单,操作简便,功能丰富。

(仅支持CentOS 6 x64)

准备工作(更新yum源和安装EPEL)

yum -y install wget
echo "timeout=120" >> /etc/yum.conf
yum -y update
yum -y install epel-release
rm -rf /etc/yum.repos.d/CentOS-Base.repo
wget http://github.itzmx.com/1265578519/mirrors/master/CentOS/CentOS6-Base-itzmx.repo -O /etc/yum.repos.d/CentOS6-Base-itzmx.repo
rm -rf /etc/yum.repos.d/epel.repo
rm -rf /etc/yum.repos.d/epel-testing.repo
wget http://github.itzmx.com/1265578519/mirrors/master/EPEL/epel.repo -O /etc/yum.repos.d/epel.repo
wget http://github.itzmx.com/1265578519/mirrors/master/EPEL/epel-testing.repo -O /etc/yum.repos.d/epel-testing.repo

安装MySQL Community

rpm -ivh http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-release-el6-5.noarch.rpm
rm -rf /etc/yum.repos.d/mysql-community.repo
rm -rf /etc/yum.repos.d/mysql-community-source.repo
wget http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community.repo -O /etc/yum.repos.d/mysql-community.repo
wget http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-source.repo -O /etc/yum.repos.d/mysql-community-source.repo

安装编译包

yum -y install which file wget make automake gcc gcc-c++ pcre-devel zlib-devel openssl-devel sqlite-devel quota unzip bzip2
ulimit -n 1048576
echo "* soft nofile 1048576" >> /etc/security/limits.conf
echo "* hard nofile 1048576" >> /etc/security/limits.conf

安装Kangle

wget http://github.itzmx.com/1265578519/kangle/master/ent/e.sh -O e.sh;sh e.sh /vhs/kangle

安装Easypanel

wget http://github.itzmx.com/1265578519/kangle/master/kangle/easypanel/ep.sh -O ep.sh;sh ep.sh

安装PHP

rm -rf /vhs/kangle/ext/tpl_php52/php-templete.ini
wget http://github.itzmx.com/1265578519/kangle/master/easypanel/php-templete.ini -O /vhs/kangle/ext/tpl_php52/php-templete.ini
rm -rf /vhs/kangle/ext/tpl_php52/etc/php-node.ini
wget http://github.itzmx.com/1265578519/kangle/master/easypanel/php-node.ini -O /vhs/kangle/ext/tpl_php52/etc/php-node.ini

安装Libevent事件通知库

wget http://github.itzmx.com/1265578519/transmission/master/2.84/libevent-2.0.21-stable.tar.gz
tar zxf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure
make -s -j 4
make -s install
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
ln -s /usr/local/lib/libevent-2.0.so.5.1.9 /usr/lib/libevent-2.0.so.5.1.9
ln -s /usr/lib/libevent-2.0.so.5 /usr/local/lib/libevent-2.0.so.5
ln -s /usr/lib/libevent-2.0.so.5.1.9 /usr/local/lib/libevent-2.0.so.5.1.9

安装memcached

cd ..
yum -y install memcached php-pecl-memcache
yum -y install php-pecl-apc
rm -rf /etc/sysconfig/memcached
wget http://github.itzmx.com/1265578519/kangle/master/memcached/memcached -O /etc/sysconfig/memcached
service memcached start
chkconfig --level 2345 memcached on

安装safedog(非必需)

echo "127.0.0.1 download.safedog.cn" >> /etc/hosts
setenforce 0
wget http://github.itzmx.com/1265578519/safedog/master/2.4/safedog_linux64.tar.gz
tar xzf safedog_linux64.tar.gz
cd safedog_linux64
chmod -R 777 install.py
./install.py
sdcmd webflag 0
sdcmd twreuse 1
sdcmd sshddenyflag 1

将MySQL设置为服务

cd ..
yum -y install mysql mysql-server
rm -rf /etc/my.cnf
wget http://github.itzmx.com/1265578519/kangle/master/mysql/5.6/my.cnf -O /etc/my.cnf
service mysqld restart

安装PHP 5.2.17

wget http://github.itzmx.com/1265578519/kangle/master/php/5.2/5217/php5217.sh -O php5217.sh;sh php5217.sh

安装PHP 5.4.45

wget http://github.itzmx.com/1265578519/kangle/master/php/5.4/5445/php5445.sh -O php5445.sh;sh php5445.sh

安装PHP 5.5.38

wget http://github.itzmx.com/1265578519/kangle/master/php/5.5/5538/php5538.sh -O php5538.sh;sh php5538.sh

安装PHP 5.6.30

wget http://github.itzmx.com/1265578519/kangle/master/php/5.6/5630/php5630.sh -O php5630.sh;sh php5630.sh

安装PHP 7.0.18

wget http://github.itzmx.com/1265578519/kangle/master/php/7.0/7018/php7018.sh -O php7018.sh;sh php7018.sh

安装PHP 7.1.4

wget http://github.itzmx.com/1265578519/kangle/master/php/7.1/714/php714.sh -O php714.sh;sh php714.sh

(来源:kangle web server,linux centos 6 一键安装包,设置优化图解,DDOS Firewall 防火墙http://bbs.itzmx.com/thread-7232-1-1.html

本文距离发布已超过180天,部分内容可能会随着时间的推移变更或失效。

相关文章

发表新评论