From 689af82bc448caa1f5552b2542f533826a84c0e0 Mon Sep 17 00:00:00 2001 From: daybreakersx <39512387+daybreakersx@users.noreply.github.com> Date: Tue, 17 Jul 2018 18:47:26 +0000 Subject: [PATCH] Delete centos6-kvm.sh --- centos6-kvm.sh | 490 ------------------------------------------------- 1 file changed, 490 deletions(-) delete mode 100644 centos6-kvm.sh diff --git a/centos6-kvm.sh b/centos6-kvm.sh deleted file mode 100644 index fadbdd8..0000000 --- a/centos6-kvm.sh +++ /dev/null @@ -1,490 +0,0 @@ -#!/bin/bash -# Created by https://www.hostingtermurah.net -# Modified by 0123456 - -#Requirement -if [ ! -e /usr/bin/curl ]; then - yum -y update && yum -y upgrade - yum -y install curl -fi - -# initializing var -OS=`uname -m`; -MYIP=$(curl -4 icanhazip.com) -if [ $MYIP = "" ]; then - MYIP=`ifconfig | grep 'inet addr:' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d: -f2 | awk '{ print $1}' | head -1`; -fi -MYIP2="s/xxxxxxxxx/$MYIP/g"; - -# go to root -cd - -# disable se linux -echo 0 > /selinux/enforce -sed -i 's/SELINUX=enforcing/SELINUX=disable/g' /etc/sysconfig/selinux - -# set locale -sed -i 's/AcceptEnv/#AcceptEnv/g' /etc/ssh/sshd_config -service sshd restart - -# disable ipv6 -echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 -sed -i '$ i\echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6' /etc/rc.local -sed -i '$ i\echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6' /etc/rc.d/rc.local - -#Add DNS Server ipv4 -echo "nameserver 8.8.8.8" > /etc/resolv.conf -echo "nameserver 8.8.4.4" >> /etc/resolv.conf -sed -i '$ i\echo "nameserver 8.8.8.8" > /etc/resolv.conf' /etc/rc.local -sed -i '$ i\echo "nameserver 8.8.4.4" >> /etc/resolv.conf' /etc/rc.local -sed -i '$ i\echo "nameserver 8.8.8.8" > /etc/resolv.conf' /etc/rc.d/rc.local -sed -i '$ i\echo "nameserver 8.8.4.4" >> /etc/resolv.conf' /etc/rc.d/rc.local - -# install wget and curl -yum -y install wget curl - -# setting 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 epel-release-6-8.noarch.rpm -rpm -Uvh remi-release-6.rpm - -if [ "$OS" == "x86_64" ]; then - wget https://raw.githubusercontent.com/daybreakersx/premscript/master/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm - rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm -else - wget https://raw.githubusercontent.com/daybreakersx/premscript/master/rpmforge-release-0.5.3-1.el6.rf.i686.rpm - rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.i686.rpm -fi - -sed -i 's/enabled = 1/enabled = 0/g' /etc/yum.repos.d/rpmforge.repo -sed -i -e "/^\[remi\]/,/^\[.*\]/ s|^\(enabled[ \t]*=[ \t]*0\\)|enabled=1|" /etc/yum.repos.d/remi.repo -rm -f *.rpm - -# remove unused -yum -y remove sendmail; -yum -y remove httpd; -yum -y remove cyrus-sasl - -# update -yum -y update - -# install webserver -yum -y install nginx php-fpm php-cli -service nginx restart -service php-fpm restart -chkconfig nginx on -chkconfig php-fpm on - -# install essential package -yum -y install wondershaper rrdtool screen iftop htop nmap bc nethogs openvpn vnstat ngrep mtr git zsh mrtg unrar rsyslog rkhunter mrtg net-snmp net-snmp-utils expect nano bind-utils -yum -y groupinstall 'Development Tools' -yum -y install cmake - -yum -y --enablerepo=rpmforge install axel sslh ptunnel unrar - -# disable exim -service exim stop -chkconfig exim off - -# setting vnstat -vnstat -u -i eth0 -echo "MAILTO=root" > /etc/cron.d/vnstat -echo "*/5 * * * * root /usr/sbin/vnstat.cron" >> /etc/cron.d/vnstat -service vnstat restart -chkconfig vnstat on - -# install screenfetch -cd -wget -O /usr/bin/screenfetch "https://raw.githubusercontent.com/daybreakersx/premscript/master/screenfetch" -chmod +x /usr/bin/screenfetch -echo "clear" >> .bash_profile -echo "screenfetch" >> .bash_profile - -# install webserver -cd -yum -y install nginx -cat > /etc/nginx/nginx.conf <" > /home/vps/public_html/info.php -rm /etc/nginx/conf.d/* -args='$args' -uri='$uri' -document_root='$document_root' -fastcgi_script_name='$fastcgi_script_name' -cat > /etc/nginx/conf.d/vps.conf < pass.txt -echo "$PASS" >> pass.txt -tar cf client.tar 1194-client.ovpn pass.txt -cp client.tar /home/vps/public_html/ -cd - -#install PPTP -cd -yum -y install pptpd -cat > /etc/ppp/pptpd-options < /etc/pptpd.conf -echo "logwtmp" >> /etc/pptpd.conf -echo "localip 10.1.0.1" >> /etc/pptpd.conf -echo "remoteip 10.1.0.5-100" >> /etc/pptpd.conf -cat >> /etc/ppp/ip-up <> /etc/mrtg.cfg -sed -i 's/WorkDir: \/var\/www\/mrtg/# WorkDir: \/var\/www\/mrtg/g' /etc/mrtg/mrtg.cfg -sed -i 's/# Options\[_\]: growright, bits/Options\[_\]: growright/g' /etc/mrtg/mrtg.cfg -indexmaker --output=/home/vps/public_html/mrtg/index.html /etc/mrtg/mrtg.cfg -echo "0-59/5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg" > /etc/cron.d/mrtg -LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg -LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg -LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg -cd - -# setting port ssh -sed -i '/Port 22/a Port 143' /etc/ssh/sshd_config -sed -i '/Port 22/a Port 90' /etc/ssh/sshd_config -sed -i 's/#Port 22/Port 22/g' /etc/ssh/sshd_config -service sshd restart -chkconfig sshd on - -# install dropbear -yum -y install dropbear -echo "OPTIONS=\"-p 109 -p 110 -p 443\"" > /etc/sysconfig/dropbear -echo "/bin/false" >> /etc/shells -service dropbear restart -chkconfig dropbear on - -# install vnstat gui -cd /home/vps/public_html/ -wget https://raw.githubusercontent.com/daybreakersx/premscript/master/vnstat_php_frontend-1.5.1.tar.gz -tar xf vnstat_php_frontend-1.5.1.tar.gz -rm vnstat_php_frontend-1.5.1.tar.gz -mv vnstat_php_frontend-1.5.1 vnstat -cd vnstat -sed -i "s/\$iface_list = array('eth0', 'sixxs');/\$iface_list = array('eth0');/g" config.php -sed -i "s/\$language = 'nl';/\$language = 'en';/g" config.php -sed -i 's/Internal/Internet/g' config.php -sed -i '/SixXS IPv6/d' config.php -cd - -# install fail2ban -yum -y install fail2ban -service fail2ban restart -chkconfig fail2ban on - -# install squid -yum -y install squid -cat > /etc/squid/squid.conf <<-END -acl manager proto cache_object -acl localhost src 127.0.0.1/32 ::1 -acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 -acl localnet src 10.0.0.0/8 -acl localnet src 172.16.0.0/12 -acl localnet src 192.168.0.0/16 -acl localnet src fc00::/7 -acl localnet src fe80::/10 -acl SSL_ports port 443 -acl Safe_ports port 80 -acl Safe_ports port 21 -acl Safe_ports port 443 -acl Safe_ports port 70 -acl Safe_ports port 210 -acl Safe_ports port 1025-65535 -acl Safe_ports port 280 -acl Safe_ports port 488 -acl Safe_ports port 591 -acl Safe_ports port 777 -acl CONNECT method CONNECT -acl SSH dst xxxxxxxxx-xxxxxxxxx/32 -http_access allow SSH -http_access allow manager localhost -http_access deny manager -http_access allow localnet -http_access allow localhost -http_access deny all -http_port 8888 -http_port 8080 -http_port 8000 -http_port 80 -http_port 3128 -hierarchy_stoplist cgi-bin ? -coredump_dir /var/spool/squid -refresh_pattern ^ftp: 1440 20% 10080 -refresh_pattern ^gopher: 1440 0% 1440 -refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 -refresh_pattern . 0 20% 4320 -visible_hostname Sorrettou -END -sed -i $MYIP2 /etc/squid/squid.conf; -service squid restart -chkconfig squid on - -# install ddos deflate -cd -yum -y install dnsutils dsniff -wget https://github.com/jgmdev/ddos-deflate/archive/master.zip -unzip master.zip -cd ddos-deflate-master -./install.sh -rm -rf /root/master.zip - -# install webmin -cd -wget "http://prdownloads.sourceforge.net/webadmin/webmin-1.881-1.noarch.rpm" -yum -y install perl perl-Net-SSLeay openssl perl-IO-Tty perl-Encode-Detect -rpm -i webmin-1.881-1.noarch.rpm; -rm webmin-1.881-1.noarch.rpm -sed -i 's/ssl=1/ssl=0/g' /etc/webmin/miniserv.conf -service webmin restart -chkconfig webmin on - -# Setting IPtables -cat > /etc/iptables.up.rules <<-END -*filter -:FORWARD ACCEPT [0:0] -:INPUT ACCEPT [0:0] -:OUTPUT ACCEPT [0:0] --A FORWARD -i eth0 -o ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT --A FORWARD -i ppp0 -o eth0 -j ACCEPT --A OUTPUT -d 23.66.241.170 -j DROP --A OUTPUT -d 23.66.255.37 -j DROP --A OUTPUT -d 23.66.255.232 -j DROP --A OUTPUT -d 23.66.240.200 -j DROP --A OUTPUT -d 128.199.213.5 -j DROP --A OUTPUT -d 128.199.149.194 -j DROP --A OUTPUT -d 128.199.196.170 -j DROP --A OUTPUT -d 103.52.146.66 -j DROP --A OUTPUT -d 5.189.172.204 -j DROP -COMMIT - -*nat -:PREROUTING ACCEPT [0:0] -:OUTPUT ACCEPT [0:0] -:POSTROUTING ACCEPT [0:0] --A POSTROUTING -o eth0 -j MASQUERADE --A POSTROUTING -s 192.168.100.0/24 -o eth0 -j MASQUERADE --A POSTROUTING -s 10.1.0.0/24 -o eth0 -j MASQUERADE -COMMIT -END -sed -i '$ i\iptables-restore < /etc/iptables.up.rules' /etc/rc.local -sed -i '$ i\iptables-restore < /etc/iptables.up.rules' /etc/rc.d/rc.local -iptables-restore < /etc/iptables.up.rules - -# install bmon -yum -y install bmon - -# download script -cd -wget https://raw.githubusercontent.com/daybreakersx/premscript/master/install-premiumscript.sh -O - -o /dev/null|sh - -# cron -service crond start -chkconfig crond on - -# set time GMT +8 -ln -fs /usr/share/zoneinfo/Asia/Manila /etc/localtime - -# finalizing -chown -R nginx:nginx /home/vps/public_html -service nginx start -service php-fpm start -service vnstat restart -service openvpn restart -service snmpd restart -service sshd restart -service dropbear restart -service fail2ban restart -service squid restart -service webmin restart -service pptpd restart -service crond start -chkconfig crond on -service pptpd restart - -#clearing history -history -c - -# info -clear -echo " " -echo "INSTALLATION COMPLETE!" -echo " " -echo "--------------------------- Setup Server Information ---------------------------" -echo " Copyright HostingTermurah.net " -echo " https://www.hostingtermurah.net " -echo " Created By Steven Indarto(fb.com/stevenindarto2) " -echo " Modified by 0123456 " -echo "--------------------------------------------------------------------------------" -echo "" | tee -a log-install.txt -echo "Server Included" | tee -a log-install.txt -echo " - Timezone : Asia/Manila (GMT +8)" | tee -a log-install.txt -echo " - Fail2Ban : [ON]" | tee -a log-install.txt -echo " - IPtables : [ON]" | tee -a log-install.txt -echo " - DDeflate : [ON]" | tee -a log-install.txt -echo " - Auto-Reboot : [OFF]" | tee -a log-install.txt -echo " - IPv6 : [OFF]" | tee -a log-install.txt -echo "" | tee -a log-install.txt -echo "Application & Port Information" | tee -a log-install.txt -echo " - OpenVPN : TCP 1194 " | tee -a log-install.txt -echo " - OpenSSH : 22, 143" | tee -a log-install.txt -echo " - Dropbear : 109, 110, 443" | tee -a log-install.txt -echo " - Squid Proxy : 80, 8000, 8080, 8888, 3128 (limit to IP Server)" | tee -a log-install.txt -echo " - Badvpn : 7300" | tee -a log-install.txt -echo " - Nginx : 85" | tee -a log-install.txt -echo " - PPTP VPN : 1732" | tee -a log-install.txt -echo "" | tee -a log-install.txt -echo "Server Tools" | tee -a log-install.txt -echo " - htop" | tee -a log-install.txt -echo " - iftop" | tee -a log-install.txt -echo " - mtr" | tee -a log-install.txt -echo " - nethogs" | tee -a log-install.txt -echo " - screenfetch" | tee -a log-install.txt -echo "" | tee -a log-install.txt -echo "Premium Script Information" | tee -a log-install.txt -echo " Type menu to display the command lists" | tee -a log-install.txt -echo "" | tee -a log-install.txt -echo " Explanation of scripts and VPS setup" | tee -a log-install.txt -echo " follow this link: http://bit.ly/penjelasansetup" | tee -a log-install.txt -echo "" | tee -a log-install.txt -echo "Important Information" | tee -a log-install.txt -echo " - Download Config OpenVPN : http://$MYIP:85/client.ovpn" | tee -a log-install.txt -echo " Mirror (*.tar.gz) : http://$MYIP:85/openvpn.tar.gz" | tee -a log-install.txt -echo " - Webmin : http://$MYIP:10000/" | tee -a log-install.txt -echo " - Vnstat : http://$MYIP:85/vnstat/" | tee -a log-install.txt -echo " - MRTG : http://$MYIP:85/mrtg/" | tee -a log-install.txt -echo " - Installation Log : cat /root/log-install.txt" | tee -a log-install.txt -echo "" | tee -a log-install.txt -echo "----------- Script Created By Steven Indarto(fb.com/stevenindarto2) ------------" -echo "------------------------------ Modified by 0123456 -----------------------------" \ No newline at end of file