Linux下PHP扩展PDO编译安装 By duncan21Posted on 2017 年 1 月 18 日2017 年 1 月 18 日Posted in LinuxTagged pdo, pdo_mysqlNo Comments on Linux下PHP扩展PDO编译安装 背景: 最近,有个新站点上线,程序使用的是pdo连接MySQL,但是线上的php在当初安装的时候没有编译pdo, 同时,由于是线上服务,不能重新编译php所以,考虑使用php的扩展编译方法来实现。[……] 阅读全文 Read More
重启nginx后丢失nginx.pid问题解决 By duncan21Posted on 2016 年 12 月 29 日Posted in LinuxNo Comments on 重启nginx后丢失nginx.pid问题解决 使用nginx -s reload的时候出现: [error]: invalid PID number “” in “/var/run/nginx.pid” 网上找的的解释:[……] 阅读全文 Read More
如何更换linode机房的centos7的内核? By duncan21Posted on 2016 年 12 月 8 日2017 年 4 月 7 日Posted in LinuxTagged 跟换内核No Comments on 如何更换linode机房的centos7的内核? 终于用上了Linode的机房的vps,弄好了系统之后发现,内核不支持pptp.机房技术答复说,需要更换系统内核,我已centos7为例,其他版本的系统请参考文章结尾处的链接 下面是操作步骤:[……] 阅读全文 Read More
为网站的cookie添加httponly参数已提高网站的安全性 By duncan21Posted on 2016 年 12 月 8 日2016 年 12 月 8 日Posted in Linux, securityTagged cookie, httponlyNo Comments on 为网站的cookie添加httponly参数已提高网站的安全性 步骤1:在wp-config.php文件中加入下面的行 @ini_set(‘session.cookie_httponly’, true); @ini_set(‘session.cookie_[……] 阅读全文 Read More
日常工作中用到的tar命令总结 By duncan21Posted on 2016 年 12 月 5 日2017 年 1 月 25 日Posted in LinuxTagged tarNo Comments on 日常工作中用到的tar命令总结 #将指定文件中的文件进行打包,并放到/root目录下 tar -T mr_zx_url.txt -czvf ~/images.tar.gz #查看tar文件中的文件数量 tar -z[......]阅读全文 Read More
[转]CentOS7修改服务器主机名方法 By duncan21Posted on 2016 年 11 月 21 日Posted in LinuxTagged centos7No Comments on [转]CentOS7修改服务器主机名方法 CentOS7修改服务器主机名方法 CentOS7下修改主机名 第一种:hostname 主机名 01.hostname 主机名称 这种方式,只能修改临时的主机名,[……] 阅读全文 Read More
升级网站支持 ALPN By duncan21Posted on 2016 年 11 月 11 日2016 年 11 月 11 日Posted in LinuxTagged openssl, openssl升级No Comments on 升级网站支持 ALPN 先来回顾一下,浏览器在访问 HTTPS 网站时,如何得知服务端是否支持 HTTP/2?答案是借助 HTTP/2 的协议协商机制:在 HTTP/2 Over HTTP 中,可以使用 HTTP 的 Upg[……] 阅读全文 Read More
nginx平滑升级并且保持不间断服务 By duncan21Posted on 2016 年 11 月 2 日2016 年 11 月 2 日Posted in LinuxTagged ngixnNo Comments on nginx平滑升级并且保持不间断服务 1. 开始之前先查看一下当前使用的版本。 [root@teddy nginx-1.10.2]# /application/nginx-1.10.2/sbin/nginx -V nginx vers[......]阅读全文 Read More
测试Nginx服务器开启pagespeed加速 By duncan21Posted on 2016 年 10 月 31 日2016 年 10 月 31 日Posted in LinuxTagged ngixn, pagespeedNo Comments on 测试Nginx服务器开启pagespeed加速 #进入 nginx 源码同级目录,我的是在/root下面 cd /root #下载最新的稳定版模块 wget https://github.com/pagespeed/ngx_pagespe[……] 阅读全文 Read More
nginx防止sql注入攻击安全设置 By duncan21Posted on 2016 年 10 月 31 日Posted in LinuxTagged sql注入No Comments on nginx防止sql注入攻击安全设置 cat security.conf ## Block SQL injections if ($request_uri ~* "[+|(%20)]union[+|(%20)]") { ret[......]阅读全文 Read More
工作中nginx的重写案例记录 By duncan21Posted on 2016 年 10 月 31 日Posted in LinuxTagged 301, nginx, rewriteNo Comments on 工作中nginx的重写案例记录 需求: 因为运营的需求,需要将所有网站的目录test1的访问请求跳转到tes2, 如何将abc.com/test1/1.html ?301跳转到#abc.com/test2/1.html([……] 阅读全文 Read More
Linux下pxe+dhcp+http+kickstart无人值守自动安装系统部署 By duncan21Posted on 2016 年 10 月 10 日Posted in LinuxTagged 批量安装No Comments on Linux下pxe+dhcp+http+kickstart无人值守自动安装系统部署 适用场景: 1)需要部署上百台甚至上千上万台的系统安装 2)没有光驱 1.pxe介绍 PXE(preboot execute environment,预启动执行环境)是[……] 阅读全文 Read More
[转]php-fpm出现setrlimit(RLIMIT_NOFILE) failed 异常 By duncan21Posted on 2016 年 9 月 22 日2016 年 9 月 22 日Posted in LinuxTagged php, setrlimitNo Comments on [转]php-fpm出现setrlimit(RLIMIT_NOFILE) failed 异常 php-cgi日志php-fpm出现setrlimit(RLIMIT_NOFILE) failed 错误 tail -n 100 php-fpm.log [WARNING] fpm_std[……] 阅读全文 Read More
日常总结检查服务器及网站运行是否正常的几条 By duncan21Posted on 2016 年 9 月 18 日2016 年 9 月 18 日Posted in LinuxNo Comments on 日常总结检查服务器及网站运行是否正常的几条 检查服务器的网卡流量,一般有会有安装cacti或者zabbix,看看是否与异常或者波动很剧烈的流量 top检查是否有异常的进程 df -h,检查磁盘是否已经满了[……] 阅读全文 Read More
[转]centos7 开机/etc/rc.local 不执行的问题 By duncan21Posted on 2016 年 9 月 14 日Posted in LinuxTagged centos7, rc.localNo Comments on [转]centos7 开机/etc/rc.local 不执行的问题 最近发现centos7 的/etc/rc.local不会开机执行,于是认真看了下/etc/rc.local文件内容的就发现了问题的原因了 #!/bin/bash #?T[......] 阅读全文 Read More
nginx的安全配置 By duncan21Posted on 2016 年 9 月 6 日2016 年 9 月 6 日Posted in LinuxTagged nginx, phpNo Comments on nginx的安全配置 网站的目录结构: 2 directories, 7 files 需求: 1.网站根目录下,只允许访问index.php,其他任何php文件不得访问。即不能访问1.php和te[……] 阅读全文 Read More
[转]rsync+inotify实现实时同步案例 By duncan21Posted on 2016 年 8 月 22 日2021 年 7 月 15 日Posted in LinuxTagged inotify, rsync 随着应用系统规模的不断扩大,对数据的安全性和可靠性也提出的更好的要求,rsync在高端业务系统中也逐渐暴露出了很多不足,首先,rsync同步数据时,需要扫描所有文件后进行比对,进行差量传输。如果文件数[……] 阅读全文 Read More
[转]linux下vim命令大全 By duncan21Posted on 2016 年 8 月 22 日2021 年 6 月 24 日Posted in LinuxTagged vi, vim 进入vi的命令 vi filename :打开或新建文件,并将光标置于第一行首 vi +n filename :打开文件,并将光标置于第n行首 vi + filename :[……] 阅读全文 Read More
为wordpress升级php到最新的版本7 By duncan21Posted on 2016 年 8 月 3 日2016 年 8 月 25 日Posted in LinuxTagged php7 具体的步骤如下所示: 下载和解压略 ./configure \ --prefix=/application/php7 \ --with-config-file-path=/[......]阅读全文 Read More
jailkit实战 By duncan21Posted on 2016 年 6 月 12 日2021 年 4 月 15 日Posted in LinuxTagged jailkit jailkit 是一款能够在一个chroot jail中快速创建受限用户帐户的工具集。它包含了一个安全日志守护进程,shells可以限制用户,开启和设置chroot jail守护进程的工具。 简单说[……] 阅读全文 Read More