
前言
因为最近在学习linux,而最好的学习就是实践,学习linux同时安装LAMP的环境搭配,跑了度娘都没找到我想要的文章。那我就简单的写写我在centos7下安装laravel的安装过程。
网络设置
ping 114.114.114.144 网络连接失败,将虚拟机的网络适配器改成桥接模式(自动),然后设置开启启动
打开 /etc/sysconfig/network-scripts/ifcfg-eno16777736,ifcfg-eno16777736是自己对应的配置文件
将里面的ONBOOT改为yes,重启网络服务`systemctl restart network`, 再ping就ok了
升级
//升级所有包同时也升级软件和系统内核
yum -y update
SELinux 宽容模式保证安装过程不受影响,其次在项目中,也要关闭
setenforce 0
安装Apache
//安装
yum -y install httpd
//同时安装vim
yum install vim
//修改Apache配置文件指向路径
/etc/httpd/conf/httpd.conf
//启动Apache
systemctl start httpd
//停止Apache
systemctl stop httpd
//重启Apache
systemctl restart httpd
//查看Apache状态
systemctl status httpd
// 配置Apache开机启动项
/*chkconfig –add httpd (在服务清单中添加httpd服务)*/
chkconfig httpd on
安装MySql
//如果必须要安装MySQL,首先必须添加mysql社区repo通过输入命
sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
//最后使用像安装MySQL的常规方法一样安装
//安装mysql命令
yum -y installmysql mysql-devel mysql-server mysql-libs
//创建root用户密码
mysqladmin -u root password 密码
//如果要用外部软件连接数据库关闭防火墙
systemctl stop firewalld
//查看防火墙状态
firewall-cmd –state
//禁止firewall开机启动
systemctl disable firewalld
//设置远程连接
GRANT ALL PRIVILEGES ON *.* TO root@% IDENTIFIED BY root WITH GRANT OPTION;
//重启mysql
systemctl restart mysqld
cd ..//
安装PHP5.6
//系统默认安装的是php5.4,对于使用laravel就不行的,以下是CentOS 7.0的epel及remi源。
yum -y install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
//使用yum list命令查看可安装的包(Packege)。
yum list –enablerepo=remi –enablerepo=remi-php56 | grep php
//安装php5.6及部分扩展
yum -y install –enablerepo=remi –enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof
//查看版本
php-v
安装redis
//检查安装依赖程序
yum install gcc-c
yum install -y tcl
//获取安装文件
wget http://download.redis.io/releases/redis-3.2.9.tar.gz
tar xzf redis-3.2.9.tar.gz
mv redis-3.2.9 /usr/local/redis
//进入目录
cd /usr/local/redis
//编译安装
make