
linux
有梦想的
主要是记录开发过程中遇到的问题,便于日后查阅,温故而知新。 技术交流V:kaifa8898
展开
-
linux挂载 磁盘 unknown filesystem type '(null)'
CentOS挂载磁盘:sudo mount /dev/xxxx /xxx1结果:mount: /dev/xxxx is write-protected, mounting read-onlymount: unknown filesystem type '(null)'解决方法:格式化磁盘:sudo mkfs.ext4 /dev/xxxx...原创 2019-12-24 23:51:17 · 5509 阅读 · 1 评论 -
linux下 chrome和chromedriver的安装
1、安装chrome用下面的命令安装最新的 Google Chromeyum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm也可以下载到本地再安装wget https://dl.google.com/linux/direct/google-chrome-stab...原创 2019-11-27 12:00:19 · 825 阅读 · 0 评论 -
php防跨站攻击.user.ini批量生成
#!/bin/bashpath='/home/wwwroot/www'for file in `ls $path`do touch .user.ini echo "open_basedir=$path/$file/:/tmp/:/proc/" > $path/$file/.user.ini chattr +i $path/$file/.user.inidone...原创 2019-11-25 10:01:14 · 956 阅读 · 0 评论 -
服务器安全问题,被入侵后的排查和处理
最近一直在研究服务器安全的问题,真正体验了什么是一个老鼠坏锅汤的真实例子。因为有个同事在某站下载了一套帝国cms仿逗游网的源码,安装在了服务器上。导致服务器上所有的大网站以及有权重有流量的站全被被劫持。曾经也有过被劫持的情况,不过都是在另外一台服务器,找到后门删了就没了。这次就不是了,严重了!服务器一共200多个网站,6个高权重网站被黑,都被插入了劫持的js代码,而且全是在主页,可能其...原创 2019-11-22 12:09:43 · 1104 阅读 · 0 评论 -
php高pv下服务器配置和进程的问题
最近服务器一直扛不住,32核32G的服务器竟然撑不起几个大流量的网站,经常性负载在50以上,但是cpu的使用率和内存使用率却很低,我看了下nginx的进程,因为没有设置的原因,都是auto状态。32核那么就会有32个worker进程,我看了下php的,竟然多达100多个,因为我安装了php7.0 5.6 5.4 这三个版本, 但是因为我进程的设置问题没有分配好,导致资源利用很浪费。...原创 2019-11-15 15:30:09 · 281 阅读 · 0 评论 -
Linux日志文件/var/log详解
如果愿意在Linux环境方面花费些时间,首先就应该知道日志文件的所在位置以及它们包含的内容。在系统运行正常的情况下学习了解这些不同的日志文件有助于你在遇到紧急情况时从容找出问题并加以解决。以下介绍的是20个位于/var/log/ 目录之下的日志文件。其中一些只有特定版本采用,如dpkg.log只能在基于Debian的系统中看到。/var/log/messages — 包括整体系统信息,其中也包...原创 2019-10-12 10:27:02 · 840 阅读 · 0 评论 -
shell遍历文件夹 php执行文件
#! /bin/bashfunction read_dir(){for file in `ls /home/data/www` #注意此处这是两个反引号,表示运行系统命令do filepath="/home/data/www/"$file"/e/qqyinfu/autocheck/qqyinfu.php" if [ -f $filepath ] #注意此处之间一定要加上空格,否则会报错...原创 2019-08-21 16:50:27 · 502 阅读 · 0 评论 -
zabbix安装
1.先安装mysql2.去zabbix官网按照流程走完https://www.zabbix.com/cn/download?zabbix=4.0&os_distribution=centos&os_version=7&db=MySQL选择自己的操作系统和数据库安装配置Zabbix servera. 安装 MySQL 数据库 (自行百度)产品手册# rpm -i...原创 2019-01-05 10:46:15 · 166 阅读 · 0 评论 -
gitlab安装
参考地址 https://about.gitlab.com/install/#centos-7原创 2019-01-04 19:31:07 · 227 阅读 · 0 评论 -
gitosis安装
参考链接 https://blog.youkuaiyun.com/imzzyhello/article/details/43942237原创 2019-01-03 20:50:56 · 268 阅读 · 0 评论 -
nginx暴露目录
#暴露BD端excel数据目录location /excelData { alias /web/php_xiuxiu_admin/storage/app/tmpExcel/ ; autoindex on; # //开启目录浏览功能; autoindex_exact_size off; ...原创 2018-12-21 20:16:24 · 1351 阅读 · 0 评论 -
linux给普通用户赋予sudo权限免密码
切换到root用户下编辑sudoers文件vim /etc/sudoers找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)可以sudoers添加下面四行中任意一条youuser ALL=(ALL) ALL%youuser ALL=(ALL)...原创 2018-12-20 13:05:05 · 5276 阅读 · 0 评论 -
linux下禁止root远程登录
一、添加和root权限一样的用户 1、 adduser admin passwd admin (修改密码) 然后输入密码 (密码简单了通不过)系统提示输入确认密码后再输入一次。OK添加成功。2、修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示:vim /etc/sudoers ## Allow roo...原创 2018-12-13 19:49:39 · 19079 阅读 · 0 评论 -
Linux系统的镜像文件iso下载地址
打开如下地址http://archive.kernel.org/centos-vault/6.1/isos/x86_64/然后选择 CentOS-6.1-x86_64-bin-DVD1.iso 即可下载。原创 2018-08-08 17:53:56 · 210570 阅读 · 46 评论 -
Linux CentOS 7 编译安装PostgreSQL 10.1
重启:su postgrescd /usr/local/postgresql/bin./pg_ctl -D /usr/local/postgresql/data/ -l logfile restart配置编译安装先去官网下载需要的包https://www.postgresql.org/ftp/source/v10.1/首先进入pg压缩包目录通过tar -zxvf ....原创 2018-08-07 16:11:42 · 1260 阅读 · 0 评论 -
centos7 linux安装 postgresql 10.1
官网也有安装的方式,我习惯了编译安装。 总结编译安装的方式:第一种 yum安装:每一行代表一行命令yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpmyum install postgresql10yum ins...原创 2018-08-06 22:47:40 · 842 阅读 · 0 评论 -
启动php没发现9000端口,nginx配置问题
原本的配置应该是这样,但是通过netstat -ntpl并没有发现9000端口就需要把这段代码 location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fa...原创 2018-07-26 14:36:01 · 8565 阅读 · 2 评论 -
ssh连接的爬坑之路
ssh连接,也就是通过公钥进行免密登陆root目录需要 chmod 700 root生成秘钥:ssh-keygen -t rsa查看ssh日志:cat /var/log/secure重启ssh:systemctl restart sshd如果不小心删除了日志文件,需要执行:systemctl restart rsyslog滚动查看日志tail...原创 2018-07-07 17:45:55 · 173 阅读 · 0 评论 -
php安装swoole XML Extension not found
arning: Invalid argument supplied for foreach() in Command.php on line 249Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249Warning: Invalid argument s...原创 2018-06-11 17:43:39 · 2818 阅读 · 0 评论 -
手记linux安装tomcat
tomcat7 install:http://www.linuxidc.com/Linux/2016-09/135555.htmlinux notic command not found:http://www.jb51.net/LINUXjishu/32192.htmllinux command :rpm -qa | grep java :sel原创 2017-07-19 13:42:21 · 270 阅读 · 0 评论 -
Linux虚拟机ip为127.0.0.1的处理
Redhat系列(Cnetos)打配置文件在/etc/sysconfig/network-scripsts/ifcfg-eth0(在Centos6.5开始就有这种情况了)打开配置文件找到ONBOOT=no 要改为ONBOOT=yes 默认是ONBOOT=no,它打意思是:是否随网络服务启动,eth0生效,如果为no,则ifconfig看不到eth0原创 2017-07-18 10:05:07 · 6146 阅读 · 2 评论