从安装 centos 到运行 laravel

# 安装 centos
cd /etc/sysconfig/network-scripts/
vi ifcfg-xxx
# 修改 ONBOOT="no" 为 "yes" 
# 修改 BOOTPROTO=dhcp 为 "static"
# 虚拟机切换成桥接模式

#########################
IPADDR=your ip
NETMASK=
GATEWAY=
DNS1=
#########################
# 可以不用执行 yum update -y
systemctl restart network && mv /etc/localtime /etc/localtime.bak && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && yum install ntp -y && systemctl enable ntpd && vi /etc/sysconfig/ntpd

# 增加-g -x参数,允许ntp服务在系统时间误差较大时也能正常工作

service ntpd restart && yum install -y epel-release zip unzip vim wget ed mlocate && rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm && rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm && yum install -y php71w httpd mariadb mariadb-server php71w-mysql php71w-xml php71w-soap php71w-cli php71w-xmlrpc php71w-mbstring php71w-json php71w-gd php71w-mcrypt && systemctl enable httpd.service && systemctl enable mariadb.service && systemctl start httpd.service && systemctl start mariadb.service && systemctl start firewalld.service && firewall-cmd --zone=public --add-port=80/tcp --permanent && systemctl restart firewalld.service && mysqladmin -u root password


wget https://files.phpmyadmin.net/phpMyAdmin/4.6.4/phpMyAdmin-4.6.4-all-languages.tar.gz && tar xvfz phpMyAdmin-4.6.4-all-languages.tar.gz && rm -rf phpMyAdmin-4.6.4-all-languages.tar.gz && mv phpMyAdmin-4.6.4-all-languages /var/www/html/pmd && cd /var/www/html && cd pmd && cp config.sample.inc.php config.inc.php && vi config.inc.php


cd /var/www/html && curl -O https://getcomposer.org/installer && php installer && rm -f installer && mv composer.phar /usr/local/bin/ && composer.phar config -g repo.packagist composer https://packagist.phpcomposer.com && composer.phar create-project laravel/laravel && chmod -R 755 /var/www/html/laravel/storage /var/www/html/laravel/bootstrap/cache && chown -R apache.apache /var/www/html/laravel/storage /var/www/html/laravel/bootstrap/cache && cd /var/www/html/laravel && php artisan key:generate && php artisan make:auth && php artisan migrate && mv /var/www/html/pmd ./public && setenforce 0 && systemctl stop firewalld && vim /etc/httpd/conf/httpd.conf

1. 找到以下内容, 
Include conf.modules.d/*.conf 
在上面一行之后添加以下内容, 
LoadModule rewrite_module modules/mod_rewrite.so

2. AllowOverride None    # 改成 All

3. /var/www/html => /var/www/html/laravel/public

systemctl restart httpd && vim /var/www/html/laravel/config/database.php
# 修改 charset 和 collation 为 utf8 和 utf8_general_ci

vim /var/www/html/laravel/.env
# 在.env文件中设置如下
mysql 的 账户、密码、数据库

MAIL_DRIVER=smtp
MAIL_HOST=smtp.qq.com
MAIL_PORT=465
MAIL_USERNAME=00000000000@qq.com
MAIL_PASSWORD=填写授权码(在QQ邮箱设置-账户-POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务-生成授权码)
MAIL_ENCRYPTION=ssl

# 在config/mail.php文件中设置如下
vim /var/www/html/laravel/config/mail.php
'from' => ['address' => '00000000000@qq.com', 'name' => 'Laravel5'],


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值