一、/etc/profile文件详解(环境变量)
添加环境变量
1.编辑profile文件 [root@localhost ~]# vi /etc/profile
2.在profile文件中添加如下内容 export PATH=$PATH:/usr/local/man export PATH=$PATH:/usr/local/rabbitmq/sbin export PATH="$PATH:/usr/local/webserver/mysql/bin"
3.在profile文件中添加或修改的内容需要注销系统才能生效。同名的环境变量,后写入的起作用。或执行如下命令。 [root@localhost ~]# source /etc/profile
参考:https://www.cnblogs.com/lh03061238/p/9952659.html
参考:https://www.jianshu.com/p/1dd22f5b521a
参考:https://blog.youkuaiyun.com/thebigdipperbdx/article/details/80862224
二、/etc/sysctl.conf文件设置(修改Linux内核参数:包括TCP/IP堆栈和虚拟内存系统的高级选项)
vm.swappiness = 0 net.ipv4.neigh.default.gc_stale_time=120 net.ipv4.ip_forward = 1
# see details in https://help.aliyun.com/knowledge_detail/39428.html net.ipv4.conf.all.rp_filter=0 net.ipv4.conf.default.rp_filter=0 net.ipv4.conf.default.arp_announce = 2 net.ipv4.conf.lo.arp_announce=2 net.ipv4.conf.all.arp_announce=2
# see details in https://help.aliyun.com/knowledge_detail/41334.html net.ipv4.tcp_max_tw_buckets = 5000 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 1024 net.ipv4.tcp_synack_retries = 2
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1
kernel.sysrq=1
# Linux禁止ping以及开启ping的方法,0:允许,1:禁止。执行sysctl -p使配置文件生效。网站攻击一般是从ping开始的。 net.ipv4.icmp_echo_ignore_all=1 # 临时生效:echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all # 临时生效:sysctl -w net.ipv4.icmp_echo_ignore_all=1
# 参考:https://blog.youkuaiyun.com/yucdsn/article/details/81735328
https://www.cnblogs.com/ginvip/p/6351740.html
https://blog.youkuaiyun.com/twilight_karl/article/details/78357953
https://blog.youkuaiyun.com/py_123456/article/details/79694560