Centos 宝塔面板重启后打不开
防火墙 端口号都设置了,但是登录面板502 解决方法: 进ssh,输入命令: /etc/init.d/bt restart
Adamin90个人博客 · Linux / PHP / Android / 技术笔记
Linux命令 Linux运维
防火墙 端口号都设置了,但是登录面板502 解决方法: 进ssh,输入命令: /etc/init.d/bt restart
lsof lsof -h #查看帮助 lsof 4.82 latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man usage: [-?abhlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[gG]] [+|-e s] [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s] [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [–] [names] Defaults in parentheses; comma-separated set (s) items; dash-separated ranges. -?|-h list help -a AND selections (OR) -b avoid kernel blocks -c c cmd c ^c /c/[bix] +c w COMMAND width (9) +d s dir s files -d s select by FD set +D D dir D tree *SLOW?* +|-e s exempt s *RISKY* -i select IPv[46] files -l list UID numbers -n no host names -N select NFS files -o list file offset -O avoid overhead *RISKY* -P no port names -R list paRent PID -s list file size -t terse listing -T disable TCP/TPI info -U select Unix socket -v list version info -V verbose search +|-w Warnings (+) -X skip TCP&UDP* files -Z Z context [Z] — end option scan +f|-f +filesystem or -file names +|-f[gG] flaGs -F [f] select fields; -F? for help +|-L [l] list (+) suppress (-) link counts < l (0 = all; default = 0) +m [m] use|create mount supplement +|-M portMap registration (-) -o o o 0t offset digits (8) -p s exclude(^)|select PIDs -S [t] t second stat timeout (15) -T qs TCP/TPI Q,St (s) info -g [s] exclude(^)|select and print process group IDs -i i select by IPv[46] address: [46][proto][@host|addr][:svc_list|port_list] +|-r [t[m<fmt>]] repeat every t seconds (15); + until no files, – forever. An optional suffix to t is m<fmt>; m must separate t from <fmt> and <fmt> is an strftime(3) format for the marker line. -s p:s exclude(^)|select protocol (p = TCP|UDP) states by name(s). -u s exclude(^)|select login|UID set s -x [fl] cross over +d|+D File systems or symbolic Links names select named files or files on named file systems Anyone can list all files; /dev warnings disabled; kernel ID check disabled. lsof -i #列出所有网络链接 lsof -i tcp #列出所有tcp连接 lsof -i :3306 #列出谁在使用3306端口 lsof -p 12222 #通过进程号 查看该进程打开的文件 netstat -anp|grep 3306 tcp6 0 0 :::3306 :::* LISTEN 14364/mysqld
lnmp为了防止跨目录访问在程序跟目录创建.user.ini,而tp5安装在lnmp创建时配置的时程序目录下的public文件夹,这样会导致其无法访问public的上层目录 解决办法时进入到lnmp的文件夹工具类 cd /root/lnmp1.5/tools 运行如下命令 ./remove_open_basedir_restriction.sh 选择要移除限制的目录 比如 /home/repository/va/public 然后cd到/home/repository/va/public目录 删除.user.ini 再次访问 就正常了
最近帮朋友公司做一个关于知识产权的项目,其中一个需求是把富文本编辑器里的内容转化成pdf然后打包下载下来。 小伙伴刚开始采用了tcpdf直接把html text导出了pdf,但是这种情况下会出现不少问题,html很多样式都渲染不出来。于是乎只好另寻其他方法,然后就开始尝试wkhtmltopdf,最终效果比tcpdf要好。下面记录了一下安装过程,ps:服务器是centos 7 #下载 wkhtmltopdf rpm安装包 cd /root wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm #安装依赖 这些都执行下,否则安装会出问题 yum install -y libpng yum install -y libjpeg yum install -y openssl yum install -y icu yum install -y libX11 yum install -y libXext yum install -y libXrender yum install -y xorg-x11-fonts-Type1 yum install -y xorg-x11-fonts-75dpi #安装字体 yum install wqy-zenhei-fonts rpm -Uvh wkhtmltox-0.12.5-1.centos7.x86_64.rpm 然后没啥了。 尝试 wkhtmltopdf /root/adam.pdf 参考 https://gist.github.com/paulsturgess/cfe1a59c7c03f1504c879d45787699f5
安装qshell cd /root wget http://devtools.qiniu.com/qshell-v2.1.8.zip unzip qshell-v.2.1.8.zip mkdir tool mv qshell_linux_x64 ./tool/qshell 2.添加全局访问 vim ~/.bashrc 插入 export PATH=$PATH:/root/tool 3. 编写压缩备份脚本 vim folderback.sh #!/bin/sh BACK_DIR="/home/repository/programbackup/" #压缩目录 BACK_TARGET="/home/repository/nongwanyun/" #目标目录 DATE=`date +%F` zip -rP 密码 $BACK_DIR"nongwanyun_back_"$DATE.zip $BACK_TARGET chmod +x folderback.sh 4. 编写七牛云配置文件 cd /root/tool/ mkdir conf cd conf touch qshell.conf vim qshell.conf #输入 { "src_dir" : "/home/repository/programbackup", #要备份的目录 "bucket" : "backup", "key_prefix" : "nongwanyun/", "access_key" : "七牛ak", "secret_key" : "七牛sk", "up_host" : "", "ignore_dir" : false, "overwrite" : false, "check_exists" : false, "check_hash" : false, "check_size" : false, "rescan_local" : true, "skip_file_prefixes" : "test,demo,", "skip_path_prefixes" : "hello/,temp/", "skip_fixed_strings" : ".svn,.git", "skip_suffixes" : ".DS_Store,.exe", "log_file" : "upload.log", "log_level" : "info", "log_rotate" : 1, "log_stdout" : false } 5.编写qshell上传脚本 cd /root touch folderupload.sh vim folderupload.sh #插入 #!/bin/sh … Read more
最近发现网站好像被扫描了,想从日志里面查看哪里的问题,研究了下goaccess这个工具 goaccess 官方网站:https://goaccess.io/ #安装epel源 yum install epel-release && yum -y update #安装goaccess yum -y install goaccess #终端分析 goaccess access.log -c #输出html静态文件 goaccess access.log -o report.html –log-format=COMBINED 附一个静态分析实例 http://p8pdat7ba.bkt.clouddn.com/lingnan.html
#新建bash脚本文件 touch mysqlback.sh #编辑文件 vim mysqlback.sh #编写脚本 #!/bin/sh DB_USER="用户名" DB_PASS="密码" DB_HOST="localhost" DB_NAME="数据库名" BACK_DIR="/home/mysqlbackup" DATA=`date +%F` mysqldump –opt -u$DB_USER -p$DB_PASS -h$DB_HOST $DB_NAME | gzip > $BACK_DIR/$DB_NAME_BACKUP_$DATA.sql.tar.gz 然后就是用crontab定时执行脚本文件 #进入编辑状态 crontab -e #计划每天凌晨3点1分执行 1 3 * * * /bin/bash /dir/mysqlback.sh