从安装 centos 到运行 laravel 的配置
2024-09-05 16:18:56
# 安装 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 -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/public && php artisan key:generate && php artisan make:auth && php artisan migrate && mv /var/www/html/pmd ./ && 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'],
最新文章
- CQRS及.NET中的参考资料
- 【bzoj1367】[Baltic2004]sequence
- C#泛型-小心使用静态成员变量
- fill_parent和wrap_content的区别
- UI-程序的运行顺序
- iOS:CALayer核心动画层上绘图
- [转载]C# Random 生成不重复随机数
- struts_ognl详解
- WPF XAML之bing使用StringFormat(转)
- IOS UITextField &;UITextView
- SVN常见错误两项纪录
- JavaEE开发之SpringBoot整合MyBatis以及Thymeleaf模板引擎
- clear命令新认识
- Beamer 中的页面链接
- Django小技巧——使用package管理app
- CAP原则
- Mysql 多字段去重
- 【题解】LFYZNoip前水题赛 T6
- WPF 手机验证码 发送按钮倒计时 代码
- (转)Mysql数据库之Binlog日志使用总结
热门文章
- PHP CI 框架初识(一)
- Junit : how to add listener, and how to extends RunListener to override behaviors while failed
- c++中字符输入函数cin.getline在输入char与string时的不同
- Java中this和super的用法总结(转)
- 第一章 SpringCloud简介
- LoadRunner 技巧之 集合点设置
- SpringMVC以POST提交表单中文乱码解决方案。
- cosbench 安装
- MYSQL5.5 linux安装
- LeetCode.1047-重复删除字符串中的所有相邻重复项