Loading [MathJax]/jax/element/mml/optable/BasicLatin.js

随笔分类 -  linux

摘要:sudo apt-get install software-properties-common python-software-properties sudo add-apt-repository ppa:ondrej/phpsudo apt-get updatesudo apt-get insta 阅读全文
posted @ 2018-09-04 16:46 Forward1990 阅读(835) 评论(0) 推荐(0) 编辑
摘要:所有文件 git reset HEAD . 单个文件git reset HEAD -filename 阅读全文
posted @ 2018-07-09 16:13 Forward1990 阅读(1729) 评论(1) 推荐(0) 编辑
摘要:检查下站点nginx配置文件 是否有 location / {try_files uriuri/ =404; } 有的话把他替代下面这行 location / { try_files uriuri/ /index.php?$query_string; } 阅读全文
posted @ 2018-04-21 16:03 Forward1990 阅读(2954) 评论(0) 推荐(0) 编辑
摘要:1.检查80端口是否被占用了,输入命令netstat -ltunp 2.如果被占用,kill掉这个进程 3.如果还是报上面错误,查看nginx site-enable的默认default文件中是否有listen [::]:80 default_server;有的话把他注释掉,因为这行对应的是ipv6 阅读全文
posted @ 2018-04-21 15:58 Forward1990 阅读(1792) 评论(0) 推荐(0) 编辑
摘要:linux 在~/下, touch创建文件 .git-credentials, 用vim编辑此文件,输入内容格式: touch .git-credentials vim .git-credentials https://{username}:{password}@github.com 2. 在终端下 阅读全文
posted @ 2016-06-29 11:40 Forward1990 阅读(5444) 评论(0) 推荐(0) 编辑
摘要:sed -i "s/原字符/替换的字符/g" `grep 原字符 -rl /var/www/项目名` 阅读全文
posted @ 2015-10-22 11:43 Forward1990 阅读(228) 评论(0) 推荐(0) 编辑
摘要:需求:一个php程序要跑一段时间,但是时间不确定。问题: 当该php程序运行超过一段时间被强制断开连接。PHP本身超时处理在 php.ini 中,有一个参数 max_execution_time 可以设置 PHP 脚本的最大执行时间,但是,在 php-cgi(php-fpm) 中,该参数不会起效。真... 阅读全文
posted @ 2015-10-19 11:09 Forward1990 阅读(236) 评论(0) 推荐(0) 编辑
摘要:date >> /home/backupluc/monitor/loadavg.txttop -b -n 1 | grep Cpu >> /home/backupluc/monitor/loadavg.txttop -b -n 1 | grep average >> /home/backuplu... 阅读全文
posted @ 2015-10-13 16:38 Forward1990 阅读(382) 评论(0) 推荐(0) 编辑
摘要:我们的PHP程序有时候需要定时执行,我们可以使用ignore_user_abort函数或是在页面放置js让用户帮我们实现。但这两种方法都不太可靠,不稳定。我们可以借助Linux的Crontab工具来稳定可靠地触发PHP执行任务。下面介绍Crontab的两种方法。一、在Crontab中使用PHP执行脚... 阅读全文
posted @ 2015-09-29 17:35 Forward1990 阅读(177) 评论(0) 推荐(0) 编辑
摘要:根据php安装模式不同分为2种,一是Apache 2.0 Handler,另外一种是FPM/FastCGI如果Server API是cgi,那么在需要cron执行的php脚本的第一行额外加入一段代码#!/usr/bin/php -q(类似PERL语法),指定服务器中php可执行程序的位置,具体步骤如... 阅读全文
posted @ 2015-09-29 17:34 Forward1990 阅读(281) 评论(0) 推荐(0) 编辑
摘要:(1)最简单的解决方法就是让/etc/hosts.allow 和/etc/hosts.deny里面的所有信息都不生效,全部注销掉,重启SSH服务就可以了.但是,有时候在你修改后不久,仍然会出现/etc/hosts.deny自动修改,让你还是登录不了,此时需要检查denyhosts服务。在redhat... 阅读全文
posted @ 2015-09-17 11:19 Forward1990 阅读(3813) 评论(0) 推荐(0) 编辑
摘要:MY_URL="http://www.youwebsite.com/"RESULT=`curl -I MY_URL|grep "HTTP/1.1 502"`if [ -n "RESULT" ]; then/etc/init.d/mysql restart/etc/init.d/php5-fpm ... 阅读全文
posted @ 2015-09-08 11:40 Forward1990 阅读(273) 评论(0) 推荐(0) 编辑
摘要:head -n -3 yum.conf |tail -n +11 阅读全文
posted @ 2015-09-08 11:03 Forward1990 阅读(1769) 评论(0) 推荐(0) 编辑
摘要:1.首先安装php-apcsudo apt-get install php-pear php5-dev apache2-threaded-devsudo pecl install apc-3.1.72.再在magento /app/etc/local.xml中 ... 阅读全文
posted @ 2015-08-29 14:47 Forward1990 阅读(231) 评论(0) 推荐(0) 编辑
摘要:在/etc/hosts.allow输入(其中192.110.162.6是你要允许登陆ssh的ip,或者是一个网段192.110.162.0/24 表示192.110.162.1到192.110.162.255)sshd:192.110.162.6:allow在/etc/hosts.deny输入(表示... 阅读全文
posted @ 2015-08-19 16:21 Forward1990 阅读(171) 评论(0) 推荐(0) 编辑
摘要:who 阅读全文
posted @ 2015-08-19 11:25 Forward1990 阅读(3567) 评论(0) 推荐(0) 编辑
摘要:1,使用who命令查看当前登录状况。如图所示,通过who命令可以查看到当前用户及ip的登录情况。2,使用last命令查看最近登录情况。如图所示,last命令列出最近一段时间的用户登录时间及ip记录。3,使用lastlog命令查看各个用户登录情况如图所示,lastlog命令列出了各个用户的登录情况,如... 阅读全文
posted @ 2015-08-18 16:29 Forward1990 阅读(3349) 评论(0) 推荐(0) 编辑
摘要:cat 路径/access.log |cut -d ' ' -f 1 |sort |uniq -c | sort -nr | awk '{print $0 }' | head -n 10 阅读全文
posted @ 2015-08-18 09:46 Forward1990 阅读(824) 评论(0) 推荐(0) 编辑
摘要:默认情况下,我们买服务器都会给我们5个以上的ip,一般主机都对应一个主ip,如果想把4个剩余ip加到主机上,需要手动配置,具体操作是打开vim /etc/network/interfaces默认是auto loiface lo inet loopbackauto eth0iface eth0 ine... 阅读全文
posted @ 2015-07-31 11:03 Forward1990 阅读(1804) 评论(0) 推荐(0) 编辑
摘要:ubuntu中sendmail函数可以很方便的发送邮件,ubuntu sendmail先要安装两个包。必需安装的两个包:代码 sudo apt-get install sendmail sudo apt-get install sendmail-cf 下面几个包是可选的:代码 squirrelma... 阅读全文
posted @ 2015-07-30 14:14 Forward1990 阅读(676) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示