Centos5.4, 6, 7 搭建LAMP环境

又在折腾CentOS,以前记住的到了再次用的时候又忘了。再次总结记录一下。

1、 安装纯净系统Centos5.4,不安装任何组件;
2、 更新系统yum update -y
3、 安装VSFTP软件 yum install vsftpd -y
4、 安装MYSQL yum install mysql-server mysql mysql-devel -y

CentOS7

yum install mariadb-server mariadb

5、 安装Apache2 yum install httpd -y

yum -y install epel-release
yum -y install yum-axelget
yum clean all && yum makecache && yum -y update

echo -e “\nalias vi=vim\nalias grep=’grep –color’\n” >>~/.bashrc && source ~/.bashrc

继续阅读Centos5.4, 6, 7 搭建LAMP环境

Linux统计目录下文件个数及代码行数

统计cn目录下,php文件数量:

find cn/ -name \\\\\\\\\"*.php\\\\\\\\\" |wc -l

统计cn目录下所有php文件代码行数。

find cn/ -name \\\\\\\\\"*.php\\\\\\\\\" |xargs cat|wc -l

wc -l `find ./ -name \\\\\\\\\"*.php\\\\\\\\\"`|tail -n1

统计a目录下所有php文件代码行数,过滤了空行

find /a -name \\\\\\\\\"*.php\\\\\\\\\" |xargs cat|grep -v ^$|wc -l

修改当前目录下的文件和子目录属性

 find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

Solution for moodle statistic problem. moodle统计出错解决方案

Sometime moodle statistic doesn’t work properly. It return an error like this:

Statistics is currently in catchup mode. So far 1 day(s) have been processed and 21 are pending. 

It is a very tricky problem. Following solution is from Christopher Lawrence. It done miracles for many people. 继续阅读Solution for moodle statistic problem. moodle统计出错解决方案

修改SELinux设置,使vsftp在enforcing security enhance模式下正常运行

开了SELinux和防火墙,没想到引出了vsftp的问题。FTP登录报错:500 OOPS: cannot change directory。下面来看看产生这个问题的原因和对策。 继续阅读修改SELinux设置,使vsftp在enforcing security enhance模式下正常运行