关于 Lin Cms 全家桶部署及使用说明
关于 Lin Cms 全家桶部署及使用说明
参考文档:2019 年 最简单最通俗的 vagrant 安装使用说明,附带示例Vagrantfile
参考文档:2019年最新最快最简洁最详细的docker 和 docker-compose 安装使用说明
1:安装虚拟环境 vagrant + virtualbox
1.1 安装 virtualbox
【VirtualBox 6.0.8 platform packages 下载】
安装说明: 下一步下一步,选择下安装目录就行
1.2 安装 vagrant
安装说明: 下一步下一步,选择下安装目录就行
2:部署虚拟环境 vagrant + virtualbox
2.1 win
快捷键 ctrl+r
打开运行程序,,输入cmd
进入命令行
]
2.2 新建项目目录
mkdir lincms
2.2 下载 全家桶源码 到 lincms 项目目录
需要把 lincms(2).zip 放到 lincms 项目
请加QQ群:1020151684,
备注:我想体验lincms全家桶
然后获取全家桶源码
- 文件夹说明:
2.3: 初始化Vagrantfile
lincms
同一级 文件夹
- 命令
vagrant init
- 效果
2.4 新增box
镜像
- 命令
vagrant box add https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cloud-images/bionic/current/bionic-server-cloudimg-amd64-vagrant.box --name ubuntu/bionic
- 执行效果
2.5 修改文件内容
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.require_version ">= 1.6.0" boxes = [ { :name => "lincms", :eth1 => "10.10.1.10", :mem => "1024", :cpu => "1" } ] Vagrant.configure(2) do |config| config.vm.box = "ubuntu/bionic" boxes.each do |opts| config.vm.define opts[:name] do |config| config.vm.hostname = opts[:name] config.vm.provider "vmware_fusion" do |v| v.vmx["memsize"] = opts[:mem] v.vmx["numvcpus"] = opts[:cpu] end config.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--memory", opts[:mem]] v.customize ["modifyvm", :id, "--cpus", opts[:cpu]] end config.vm.network :private_network, ip: opts[:eth1] end end config.vm.synced_folder "./lincms", "/home/vagrant/lincms" config.vm.provision "shell", privileged: true, path: "./setup.sh" end
2.6 新增 setup.sh
文件
# Timezone sudo /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ && echo 'Asia/Shanghai' > /etc/timezone # 设置国内源 sudo mv /etc/apt/sources.list /etc/apt/sources.list.back && \ echo '# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 \n \ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse \n \ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse \n \ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse \n \ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse \n \ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse \n \ deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse \n \ deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse \n \ deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse \n \ deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse \n \ deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse' >> /etc/apt/sources.list # Libs sudo apt-get update && sudo apt-get install -y wget curl git vim gcc glibc-static telnet bridge-utils # install docker sudo curl -fsSL https://get.docker.com | sudo bash -s docker --mirror Aliyun sudo groupadd docker sudo gpasswd -a vagrant docker sudo systemctl start docker rm -rf get-docker.sh # 配置镜像加速器 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://dt77flbr.mirror.aliyuncs.com"] } EOF sudo systemctl enable docker sudo systemctl daemon-reload sudo systemctl restart docker # #下载docker-compose # sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose # #给docker-compose执行权限 # sudo chmod +x /usr/local/bin/docker-compose # #测试安装是否成功,成功的话打印出docker-compose的版本信息 # sudo docker-compose --version # 使用pip安装docker-compose sudo apt install python-pip -y sudo pip install docker-compose # 打印IP地址信息 ip a # 进入项目目录 cd lincms # 创建/启动项目 sudo docker-compose build && sudo docker-compose up -d
2.7 创建虚拟机并启动
- 命令
vagrant up lincms && vagrant ssh lincms
- 效果
后期补上
3: 部署后续资料
3.1: API接口访问地址:10.10.1.10:9000
curl 10.10.1.10:9000
如果能看到 TP5.1欢迎页面,就证明部署成功了
3.2: mysql链接地址:10.10.1.10:9001
默认创建数据库:lincms
MySQL root 密码:123456
MySQL 账户1: lincms
MySQL 密码: 123456
3.3: redis链接地址:10.10.1.10:9002
.sh 脚本 docker
安装失败,解决方式
1.Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
2.Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
3. Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below.
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
4.Update the apt package index.
sudo apt-get update
5. install
sudo apt-get install docker-ce docker-ce-cli containerd.io
相关推荐
EdwardSiCong 2020-11-23
yungpheng 2020-10-19
jipengx 2020-11-12
橄榄 2020-11-03
lyqdanang 2020-11-02
wservices 2020-10-30
onepiecedn 2020-10-29
数据人 2020-10-26
dfphoto 2020-10-16
hackerlpy 2020-09-07
tianyayi 2020-08-16
Dullonjiang 2020-08-15
fengling 2020-08-15
wordmhg 2020-08-06
guotiaotiao 2020-08-06
zhangsyi 2020-07-28
千锋 2020-07-27
ahnjwj 2020-07-28