修改phpmyadmin配置mysql端口号
当前使用phpmyadmin版本号为phpMyAdmin-4.7.5 mysql默认端口3306,如果你当前mysql不是3306,则如何通过phpmyadmin连接呢? 网上文章都是要修改phpmyadmin目录下libraries下配置文件config.d … 阅读全文
当前使用phpmyadmin版本号为phpMyAdmin-4.7.5 mysql默认端口3306,如果你当前mysql不是3306,则如何通过phpmyadmin连接呢? 网上文章都是要修改phpmyadmin目录下libraries下配置文件config.d … 阅读全文
主要通过nginx的http_limit_conn和http_limit_req模块来防御cc攻击。 ngx_http_limit_req_module可以限制单个IP每秒请求数 ngx_http_limit_conn_module可以限制单个IP的连接数 通 … 阅读全文
使用yum源直接安装nginx 1、配置nginx源 centos6:
1 |
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm |
centos7:
1 |
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm |
2、安装nginx(默认会安装最新的稳 … 阅读全文
由于部分pip安装包升级原因,安装时可能会报错,需指定版本,本文部分操作步骤可能会报错,建议有能力的进行参考! 简单方便建议使用rpm安装:https://blog.whsir.com/post-2163.html 对于KVM(kernel-based vir … 阅读全文
对于KVM(kernel-based virtual machine)大家并不陌生,它是基于内核的虚拟机,在测试或者生产环境中经常用到,由于管理起来不是很方便,我在这里推荐一个kvm web管理工具。 什么是Wok? Wok基于cherrypy的web框架,可 … 阅读全文
脚本修改默认端口,替换iptables防火墙等,内容如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
#!/bin/bash #关闭selinux sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config sed -i 's/#UseDNS yes/UseDNS no/g' /etc/ssh/sshd_config setenforce 0 #安装wget yum -y install wget yum-utils #更换yum源 repo=`ls /etc/yum.repos.d/repo.bak | wc -l` if [ $repo -eq 0 ]; then mkdir /etc/yum.repos.d/repo.bak mv /etc/yum.repos.d/CentOS* /etc/yum.repos.d/repo.bak cd /etc/yum.repos.d/ wget http://blog.whsir.com/uploads/CentOS7-Base-163.repo yum clean all yum makecache else echo "yum OK" fi #更新时间和系统 cd yum -y install vim screen ntp /usr/sbin/ntpdate ntp1.aliyun.com yum -y update #更改端口 sed -i 's/#Port 22/Port 2188/' /etc/ssh/sshd_config #设置防火墙ifconfig systemctl stop firewalld.service systemctl disable firewalld.service yum -y install iptables-services net-tools systemctl enable iptables.service sed -i 's/22/2188/' /etc/sysconfig/iptables systemctl restart iptables.service systemctl restart sshd yum -y install epel-release #关闭postfix systemctl disable postfix #更改ulimit limit=`cat /etc/security/limits.conf | grep 65535 | wc -l` if [ $limit -eq 0 ]; then echo "ulimit -SHn 65535" >> /etc/rc.local cat >> /etc/security/limits.conf << EOF * soft nofile 65535 * hard nofile 65535 EOF else echo "ulimit ok" fi #开机启动优化 for i in acpid gpm lvm2-monitor anacron haldaemon mcstrans oddjobd setroubleshoot atd halt mdmonitor pand single auditd hidd mdmpd pcscd smartd hplip messagebus avahi-daemon ip6tables microcode_ctl snmptrapd avahi-dnsconfd ipmi multipathd psacct bluetooth rawdevices svnserve conman irda netconsole rdisc cpuspeed irqbalance netfs readahead_early tcsd iscsi netplugd readahead_later winbind cups iscsid restorecond wpa_supplicant cups-config-daemon kdump NetworkManager rpcgssd dnsmasq killall nfs rpcidmapd ypbind dund krb524 nfslock rpcsvcgssd yum-updatesd firstboot lm_sensors nscd saslauthd do chkconfig $i off > /dev/null 2>&1 done date |
下载地址:
1 |
wget https://down.whsir.com/downloads/centos7init.sh |
~微信打赏~ 赏
开启mysql慢日志 MySQL的慢查询日志是MySQL提供的一种日志记录,它用来记录在MySQL中响应时间超过阀值的语句,具体指运行时间超过long_query_time值的SQL,则会被记录到慢查询日志中。long_query_time的默认值为10,意思 … 阅读全文
先安装硬件信息获取工具dmidecode yum -y install dmidecode 查看CPU详细信息 1、查看CPU物理个数 grep 'physical id' /proc/cpuinfo | sort -u | wc -l 2、查看CPU核心数 … 阅读全文
1、先停止mysql服务
1 |
/etc/init.d/mysql stop |
2、使用mysqld_safe启动mysql
1 |
/usr/local/mysql/bin/mysqld_safe --skip-grant-tables & |
3、直接登录mysql [crayon-67bb4f46 … 阅读全文
先生成个大文件,以便测试 dd if=/dev/zero of=demo.rar bs=1M count=5000 限制一个IP同一时间只允许发起一个连接,如果发起多个链接,会提示503,用户在开始的下载500m之前,下载速度可以飙到最大,但是一旦下载的文件大 … 阅读全文