- 基于Bootstrap Admin的后台管理系统
- 前端自适应
- Redis缓存网站基础配置
- 基于mailgun的邮件队列
- 基于github社交登录的文章留言
- mysql定时备份
- 基于youdao翻译的文章url slug
- 基于cloudinary的文章图片上传
- docker部署
# clone项目
git clone [email protected]:liseen315/abianji.git
# 进入到docker文件夹内
cd docker
# 根据自己环境需要更改对应的配置文件
cp env-example .env
docker-compose ps
# 当看到如下的容器后证明启动成功
# 返回项目目录
cd ..
# 进入到容器内进行进行安装
docker-compose exec workspace bash
composer install
npm install
# 设定mysql root 密码
1 update user set authentication_string=password('yourpasssword') where user='root';
2 FLUSH PRIVILEGES;
# 创建数据库
create database abianji character set utf8mb4;
# 创建新的用户
GRANT ALL ON abianji.* TO 'liseen'@'%' IDENTIFIED BY 'yourpasssword';
FLUSH PRIVILEGES;
# 开启访问权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Liseen315song' WITH GRANT OPTION;
FLUSH PRIVILEGES;
# 如果由于更改密码导致的mysql访问失败请使用如下方法解决
by setting MYSQL_VERSION=5.7 in laradock/.env
after that in your .env file see the var called DATA_PATH_HOST and go to that folder, after that delete the mysql folder there and then do the docker-compose build --no-cache mysql and then docker-compose up -d mysql
# 创建迁移
php artisan migrate
# 生成种子
php artisan db:seed
# 如果更改了网站配置字段等需要手动清理redis
flushall
# 启动容器
docker-compose up -d nginx mysql redis php-worker
# 绑定host 访问即可
127.0.0.1 abianji.com
docker-compose exec mysql bash
mysql -uliseen -pLiseen315song
# 查看mysql 时区
show variables like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | UTC |
| time_zone | SYSTEM |
+------------------+--------+
2 rows in set (0.00 sec)
# 查看mysql当前时间
select now();
+---------------------+
| now() |
+---------------------+
| 2020-01-15 01:45:17 |
+---------------------+
1 row in set (0.01 sec)
如果时区与中国相差8小时那么可以更改docker mysql内的mysql配置
# vi my.conf [mysqld] 添加时区偏移
default-time_zone = '+8:00'
docker-compose down
docker-compose build mysql
docker-compose up
# 查看mysql查询次数
show global status where variable_name in('com_select','com_insert','com_delete','com_update');
先去申请账号
# 安装phpredis
pecl install redis
# 修改php.ini
/etc/php/7.3/fpm/php.ini
# 添加到如下到php.ini
[redis]
extension=redis.so
# 重启fpm
service php7.3-fpm restart
sudo vim /etc/redis/redis.conf
# 将bind 127.0.0.1 改成 bind 0.0.0.0
# 重启
sudo /etc/init.d/redis-server restart
https://laravel-news.com/creating-helpers
默认使用拼音来处理slug 如果在.env中配置了有道翻译接口则会采用有道翻译接口
https://ai.youdao.com/fanyi-chart.s
Services Provider 使用jourdon/slug 自己改造去掉了百度,修复了Laravel 6.0兼容问题
# docker-compose 进不去容器使用
docker exec -it a144032d1598 /bin/sh 进
php artisan queue:work --queue=email --tries=3
整体参考laradock,去掉了本站无用的镜像以及相关配置,保持精简并根据本站优化,具体可以查看docker文件夹