*!/bin/sh
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo "*****************************************************************************************"
echo "*****************************************************************************************"
echo "*****************************************************************************************"
echo "** *** ****** ** ** ** * * * **"
echo "** **** ******* **** *** *** ** *** **"
echo "** ***** ******* **** ***** *** *** **** **"
echo "** ***** ****** ***** ****** *** *** ***** **"
echo "** ****** ****** ***** ****** **** *** **** **"
echo "** ****** ****** ***** ******* **** **** **** **"
echo "** ****** ****** ****** ****** ***** **** ***** **"
echo "** ****** ******* ****** ******* ***** ***** ****** **"
echo "** ****** ****** ****** ******* ***** **** ****** **"
echo "** ****** ****** ****** ******** ****** ***** ****** **"
echo "** ******* ****** ****** ******** ****** ***** ******* **"
echo "** ****** ****** ****** ******** ****** ***** ******* **"
echo "** ****** ****** ****** ******** ****** ****** ******* **"
echo "** ****** ****** ***** ******** ****** ****** ******* **"
echo "** ****** ***** ****** ******** ****** ****** ******* **"
echo "** ***** ***** ****** ******** ****** ****** ****** **"
echo "** ****** ***** ***** ******** ****** ****** ******* **"
echo "** ***** ***** ***** ******** ****** ****** ****** **"
echo "** ***** ***** ***** ******* ***** ****** ****** **"
echo "** ***** **** ***** ******* ****** ****** ****** **"
echo "** **** **** **** ****** ****** ****** ****** **"
echo "** **** *** **** ****** ****** ****** ****** **"
echo "** **** *** *** ***** ***** ***** ****** **"
echo "** **** *** *** ***** ***** ***** ***** **"
echo "** **** ** *** **** ***** ***** **** **"
echo "** ** * *** *** **** ****** *** **"
echo "** ** * ** * *** ***** * **"
echo "*****************************************************************************************"
echo "**************************** D a l o r a d i u s *********************************"
echo "*****************************************************************************************"
echo "***** ******** ******** **** ** ****** **** ***"
echo "*** ****** ***** * * **** * ***"
echo "*** **** ******* * ***** ***** ** *** **** * *** ***"
echo "**** *** ****** ** ****** ****** ** **** ***** * *******"
echo "**** * ******** ** ***** ****** ** **** ***** *** *****"
echo "**** ******* ** **** ****** ** **** ***** ****** ***"
echo "**** ** ** ** ***** ** ***** ***** ** *** **"
echo "**** *** * ****** * ** *** *** ** ** **"
echo "***** ***** * ****** * **** ***** *** ***"
echo "*****************************************************************************************"
echo "**------------------------------脚本作者:三多先生-------------------------------------**"
echo "*****************************************************************************************"
echo "+---------------------------------------------------------------------------------------+"
echo "+** 免责声明: **+"
echo "+** **+"
echo "+** 您应该对使用结果自行承担风险。作者不做任何形式的保证: **+"
echo "+** 不保证结果满足您的要求,不保证服务不中断, 不保证结果的安全性、 **+"
echo "+** 正确性、及时性、合法性。因网络状况、通讯线路、 **+"
echo "+** 第三方网站等任何原因而导致您受到法律制裁 **+"
echo "+** 作者不承担任何法律责任。 **+"
echo "+** **+"
echo "+** Email:1064331064@qq.com **+"
echo "+** 支持服务器系统环境: CentOS 7.2 **+"
echo "+***************************************************************************************+"
echo "+---------------------------------------------------------------------------------------+"
echo "**************************"
echo "*******安装源并更新*******"
echo "**************************"
yum install -y epel-release
rpm -Uvh http://dev.MysqL.com/get/MysqL-community-release-el7-5.noarch.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum update -y
echo "************************"
echo "********安装MysqL*******"
echo "************************"
yum install -y MysqL-community-server MysqL-devel MysqL-connector-odbc libdbi-dbd-MysqL
echo "**********************"
echo "*******安装wget*******"
echo "**********************"
yum -y install wget
echo "********************************"
echo "*******添加防火墙过滤规则*******"
echo "********************************"
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=MysqL
firewall-cmd --permanent --zone=public --add-port=10000/tcp
#firewall-cmd --permanent --zone=public --add-port=10/udp
firewall-cmd --permanent --zone=public --add-service=openvpn
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j MASQUERADE
echo "************************"
echo "*******重启防火墙*******"
echo "************************"
systemctl restart firewalld.service
echo "***********************"
echo "*******安装MysqL*******"
echo "***********************"
yum install -y MysqL-community-server MysqL-devel MysqL-connector-odbc libdbi-dbd-MysqL
echo "***************************"
echo "*******创建MysqL密码*******"
echo "***************************"
#MysqL_secure_installation
#MysqLadmin -uroot password "radiusMysqL"
echo "****************************"
echo "*******安装FreeRadius*******"
echo "****************************"
yum install -y freeradius freeradius-utils freeradius-MysqL
echo "*************************"
echo "*******清除yum缓存*******"
echo "*************************"
yum clean all
echo "**************************"
echo "*******安装监测系统*******"
echo "**************************"
yum install -y sysstat
echo "**************************"
echo "*******安装授时服务*******"
echo "**************************"
yum install -y ntpd
yum install -y ntp
yum install -y mod_ssl haproxy squid httpd dnsmasq exim
echo "*************************"
echo "*******安装Apache2*******"
echo "*************************"
yum install -y httpd
echo "**********************"
echo "*******安装PHP********"
echo "**********************"
yum -y install unzip zip PHP PHP-ldap PHP-odbc PHP-pear PHP-xml PHP-xmlrpc PHP-mbstring PHP-snmp PHP-soap curl curl-devel PHP-MysqL PHP-gd PHP-pear-DB gcc gcc make vim-enhanced libxml2 libxslt pkgconfig zlib-devel gcc-c++ libgcrypt-devel crypt*
echo "***************************************"
echo "*******apache添加目录权限**************"
echo "***************************************"
chown apache.apache -R /var/www/html
echo "*********************************"
echo "*******安装Squid代理服务器*******"
echo "*********************************"
yum install squid -y
yum install iptables-services -y
#function openvpn_install
#{
#wget https://github.com/Nyr/openvpn-install/blob/master/openvpn-install.sh
#cd /root
#chmod 777 /root/openvpn-install.sh
#./openvpn-install.sh
#cd /root
#wget http://www.nongnu.org/radiusplugin/radiusplugin_v2.1a_beta1.tar.gz
#tar -zxvf radiusplugin_v2.1a_beta1.tar.gz
#cd radiusplugin_v2.1a_beta1
#make > /dev/NULL
#cp radiusplugin.so /etc/openvpn > /dev/NULL
#cp radiusplugin.cnf /etc/openvpn > /dev/NULL
#cd /root
#}
#################################################################################
function web_install
{
wget http://nchc.dl.sourceforge.net/project/daloradius/daloradius/daloradius0.9-9/daloradius-0.9-9.tar.gz
mkdir /var/www/html/daloradius
tar zxvf daloradius-0.9-9.tar.gz
mv daloradius-0.9-9/* /var/www/html/daloradius/
mkdir /var/www/html/daloradiususers/
mv /var/www/html/daloradius/daloradius-users/* /var/www/html/daloradiususers/
#修改权限
chmod 644 /etc/raddb/dictionary
chown apache /etc/raddb
chown apache /etc/raddb/clients.conf
chown -R apache:apache /var/www/html/daloradius/*
chown -R apache:apache /var/www/html/daloradiususers/*
cd /root/
echo "********************************"
echo "*******安装webmin管理面板*******"
echo "********************************"
echo "[Webmin]
name=Webmin Distribution Neutral
baseurl=http://download.webmin.com/download/yum
enabled=1
gpgcheck=1
gpgkey=http://www.webmin.com/jcameron-key.asc" >/etc/yum.repos.d/webmin.repo;
yum -y install webmin
echo "************************************"
echo "*******安装PHPMyAdmin管理面板*******"
echo "************************************"
cd /root/
wget https://files.PHPmyadmin.net/PHPMyAdmin/4.4.15.10/PHPMyAdmin-4.4.15.10-all-languages.zip
unzip PHPMyAdmin-4.4.15.10-all-languages.zip
mkdir /var/www/html/PHPMyAdmin
mv /root/PHPMyAdmin-4.4.15.10-all-languages/* /var/www/html/PHPMyAdmin
}
#####################################################################################
function delete_file
{
#移除下载残留文件daloradius-0.9-9.tar.gz
rm -rf /root/daloradius-0.9-9.tar.gz
rm -rf /root/daloradius-0.9-9
#移除下载残留文件PHPMyAdmin-4.4.15.10-all-languages.zip
rm -rf /root/PHPMyAdmin-4.4.15.10-all-languages
rm -rf /root/PHPMyAdmin-4.4.15.10-all-languages.zip
#rm -rf /root/radiusplugin_v2.1a_beta1
#rm -rf /root/radiusplugin_v2.1a_beta1.tar.gz
#apache删除默认测试页
rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html
}
###############调用安装命令######################################################################
web_install
openvpn_install
delete_file
echo "+---------------------------------------------------------------------+"
echo "+ 运行启动命令: +"
echo "+ 启动Squid代理 +"
echo "+ 启动Apache2 :systemctl restart httpd.service +"
echo "+ 启动MysqL :systemctl restart MysqLd.service +"
echo "+ 启动radius :systemctl restart radiusd.service +"
echo "+ 启动firewalld: systemctl restart firewalld.service +"
echo "+---------------------------------------------------------------------+"
echo "*******启动Squid代理服务器*******"
service squid start
echo "开机启动Apache2"
systemctl enable httpd.service
echo "*******启动Apache2*******"
systemctl restart httpd.service
echo "*******开机启动MysqL*******"
systemctl enable MysqLd.service
echo "*******启动MysqL*******"
systemctl restart MysqLd.service
echo "*******开机启动radius*******"
systemctl enable radiusd.service
echo "*******启动radius*******"
systemctl restart radiusd.service
echo "*******启动openvpn*******"
systemctl enable openvpn@servic.service
#systemctl status openvpn@server.service
systemctl start openvpn@server.service
echo "*******开机启动firewalld*******"
systemctl enable firewalld.service
echo "*******启动firewalld*******"
systemctl restart firewalld.service
echo "*****************************************************************************************"
echo "*****************************************************************************************"
echo "*****************************************************************************************"
echo "*****************************************************************************************"
echo "** *** ****** ** ** ** * * * **"
echo "** **** ******* **** *** *** ** *** **"
echo "** ***** ******* **** ***** *** *** **** **"
echo "** ***** ****** ***** ****** *** *** ***** **"
echo "** ****** ****** ***** ****** **** *** **** **"
echo "** ****** ****** ***** ******* **** **** **** **"
echo "** ****** ****** ****** ****** ***** **** ***** **"
echo "** ****** ******* ****** ******* ***** ***** ****** **"
echo "** ****** ****** ****** ******* ***** **** ****** **"
echo "** ****** ****** ****** ******** ****** ***** ****** **"
echo "** ******* ****** ****** ******** ****** ***** ******* **"
echo "** ****** ****** ****** ******** ****** ***** ******* **"
echo "** ****** ****** ****** ******** ****** ****** ******* **"
echo "** ****** ****** ***** ******** ****** ****** ******* **"
echo "** ****** ***** ****** ******** ****** ****** ******* **"
echo "** ***** ***** ****** ******** ****** ****** ****** **"
echo "** ****** ***** ***** ******** ****** ****** ******* **"
echo "** ***** ***** ***** ******** ****** ****** ****** **"
echo "** ***** ***** ***** ******* ***** ****** ****** **"
echo "** ***** **** ***** ******* ****** ****** ****** **"
echo "** **** **** **** ****** ****** ****** ****** **"
echo "** **** *** **** ****** ****** ****** ****** **"
echo "** **** *** *** ***** ***** ***** ****** **"
echo "** **** *** *** ***** ***** ***** ***** **"
echo "** **** ** *** **** ***** ***** **** **"
echo "** ** * *** *** **** ****** *** **"
echo "** ** * ** * *** ***** * **"
echo "*****************************************************************************************"
echo "**************************** D a l o r a d i u s *********************************"
echo "*****************************************************************************************"
echo "***** ******** ******** **** ** ****** **** ***"
echo "*** ****** ***** * * **** * ***"
echo "*** **** ******* * ***** ***** ** *** **** * *** ***"
echo "**** *** ****** ** ****** ****** ** **** ***** * *******"
echo "**** * ******** ** ***** ****** ** **** ***** *** *****"
echo "**** ******* ** **** ****** ** **** ***** ****** ***"
echo "**** ** ** ** ***** ** ***** ***** ** *** **"
echo "**** *** * ****** * ** *** *** ** ** **"
echo "***** ***** * ****** * **** ***** *** ***"
echo "*****************************************************************************************"
echo "**------------------------------脚本作者:三多先生-------------------------------------**"
echo "***********************************安 装 完 毕!*****************************************"
echo "+---------------------------------------------------------------------------------------+"
echo "+** DalorRdiu-Platforms: IP:80 administrator/radius **+"
echo "+** DalorRdius-Users : IP:80 **+"
echo "+** Radius : IP:1812/1813 **+"
echo "+** OpenVPN : IP:1194 **+"
echo "+** Web Shell : IP: **+"
echo "+** Webmin : IP:10000 root/password(ROOT密码) **+"
echo "+** PHPMyAdmin : IP:/PHPMyAdmin 密码:radiusMysqL **+"
echo "+** SSH : IP:22 **+"
echo "+** Email:1064331064@qq.com **+"
echo "+** 脚本支持 : CentOS 7.2 系统 **+"
echo "+***************************************************************************************+"
echo "+---------------------------------------------------------------------------------------+"
QQ1064331064
原文链接:https://www.f2er.com/centos/378354.html