21.Apache目录

发表于 linux 分类,标签:
Apache相关文件/目录Web目录:/var/www安装目录:/etc/apache2全局配置:/etc/apache2/apache2.conf监听端口:/etc/apache2/ports.conf虚拟主机:/etc/apache2/sites-enabled/000-default.confApache脚本相关操作开启:sudo/etc/init.d/apache2start重启:sudo/etc/init.d/apache2restart停止:sudo/etc/init.d/apache2stop状态:sudo/etc/init.d/apache2status...

20.20220705_更新故障

发表于 随笔 分类,标签:
20220705_更新故障正常更新企业版vip前后端,前期一切顺利,到最后赋权限的时候执行时间过久,ctrl+c重新执行,仍是如此,卡顿时间为19:00整;经过长时间等待和多次重新尝试,问题仍然存在,然后打电话向上级说明情况;紧接着,在17:00到20:00之间,多个重要站点出现无法访问404,访问速度非常慢,无法登录和推出等问题;持续了半小时后,没做任何操作又恢复正常,各个站点测试均无问题;正常推代码后测试无误下班。监控显示有可能是硬盘繁忙导致该问题;后仔细核对服务器操作过程,没有发现任何操作失误,排除因操作失误导致该问题;经过逐一排查问题原因,发现是nginx三个负载其中一个nginx日志无新增,判断该nginx宕机;再深入查看,判断问题原因是三台负载其中一台服务器nfs挂载盘故障,重启该服务器后恢复正常。...

19.rsync同步

发表于 linux 分类,标签:
一、单个主机本地之间的数据传输1、将a目录内容同步到b目录rsync-avz--progressa/b2、将/tmp/2021/a/hell.txt文件复制到/tmp/2021/b/目录下rsync--progress/tmp/2021/a/hell.txt/tmp/2021/b/二、ssh通道来传输数据1、将/tmp/2021/a/目录内容同步到远程主机的/tmp/2021/c目录(需输入密码)rsync-r--progress/tmp/2021/a/mysql@192.168.136.136:/tmp/2021/c-e'ssh-p22'三、守护进程模式服务端配置设置selinux为disabled,需要重启生效vi/etc/selinux/configSELINUX=disabled1、安装yuminstallr...

18.免密登录

发表于 linux 分类,标签:
一、生成公私钥1.生成密钥ssh-keygen -t rsa         #生成免密登录公私钥,根据提示按回车或y2.查看ls -lha             #.ssh目录默认隐藏,可使用ls -lha 查看authorized_keys        #存放远程免密登录的公钥,主要通过这个文件记录多台机器的公钥(如没有,可touch 创建)know_hosts   &nbs...

17.备份nginx日志

发表于 linux 分类,标签:
#!/bin/bash#199服务器大于180天的删除linshi=`ssh root@43.254.2.199 "ls /data/wwwlogs/tengine65 |grep ".gz" | wc -l"`ssh -Tq root@43.254.2.199 << eeooffif [ $linshi -gt 180 ]; then   find /data/wwwlogs/tengine65 -type f -mtime +180 -name&nb...

16.nginx配置文件

发表于 linux 分类,标签:
#user  nobody;worker_processes  1;#error_log  logs/error.log;#error_log  logs/error.log  notice;#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {    worker_connections  1024;}http {   ...

15.知识库备份

发表于 linux 分类,标签:
#!/bin/bashsource /etc/profilesource ~/.bash_profileset -o nounsetfile=`date "+%Y_%m_%d" -d "1 day ago"`docker cp confluence:/var/atlassian/confluence/backups/backup-"$file".zip /data/shell/zsk/docker exec confluence /bin/bash -c 'find /var/atlassian/confluence/ba...

14.nginx安装脚本

发表于 linux 分类,标签:
[root@localhost ~]# cat nginx.sh #!/bin/bashversion=nginx-1.20.1.tar.gzname=nginx-1.20.1install_dir=/usr/locallog=/var/log/nginx#解决依赖关系yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel wget gd-devel gcc gcc-c++yum -y groups mark install 'Developme...

13.nginx日志分割

发表于 linux 分类,标签:
脚本说明:每天00:00定时切割Nginx日志[root@check1 ~]# cat /etc/crontab SHELL=/bin/bashPATH=/sbin:/bin:/usr/sbin:/usr/binMAILTO=rootHOME=/# For details see man 4 crontabs# Example of job definition:# .---------------- minute (0 - 59)# | .------------- hour (0 - ...

12.固定ip登录

发表于 linux 分类,标签:
实践:centos7下:vim/etc/hosts.allowsshd:ipvim/etc/hosts.denysshd:ALL重启:systemctlrestartsshdandnetworkcentos8下:链接:https://blog.csdn.net/tiging/article/details/116890319允许192.168.142.166访问5432端口firewall-cmd--permanent--add-rich-rule="rulefamily="ipv4"sourceaddress="192.168.142.166"portprotocol="tcp"port="5432"accept"查看列表firewall-cmd--list...