因为要用到Linux的crontab,所以要先配置lamp环境。去网上找了下,把步骤几下来。
安装环境前可以先把yum更新到最新,使用如下命令:
yum update
更新好之后,安装两款必要的软件:gcc和gcc-c++
先查看自己有没有安装:
rpm -qa|grep gcc
rpm -qa|grep gcc-c++
没有的话,开始安装
yum install gcc
yum install gcc-c++
全部OK后,检查一下系统中有没有lamp软件,例如
rpm -q httpd
若果有,卸载
rpm -e httpd
或者:
rpm -e --nodeps httpd //不管依赖关系,强制卸载
开始一键安装:
https://blog.linuxeye.cn/31.html
安装步骤
- yum -y install wget screen curl python#for CentOS/Redhat
- #apt-get -y install wget screen curl python# for Debian/Ubuntu
- wget http://aliyun-oss.linuxeye.com/lnmp-full.tar.gz #阿里云经典网络内网下载
- wget http://mirrors.linuxeye.com/lnmp-full.tar.gz # 包含源码,国内外均可下载
- wget http://mirrors.linuxeye.com/lnmp.tar.gz # 不包含源码,建议仅国外主机下载
- tar xzf lnmp-full.tar.gz
- #tar xzf lnmp.tar.gz
- cd lnmp # 如果需要修改目录(安装、数据存储、Nginx日志),请修改options.conf文件
- screen -S lnmp # 如果网路出现中断,可以执行命令`screen -R lnmp`重新连接安装窗口
- ./install.sh # 请勿sh install.sh或者bash install.sh这样执行
来源:http://www.cnblogs.com/5idd/p/7607310.html