当前位置:   article > 正文

项目搭建(五)Linux搭建WebStack-Laravel

webstack-laravel

一、安装docker服务

1、yum执行docker安装命令

yum install docker-io -y
  • 1

2、完成安装后,查看是否安装成功
docker --version

[root@lsxxxxxxQ ~]# docker --version
Docker version 20.10.17, build 100c701
  • 1
  • 2

3、启动docker

systemctl start docker
  • 1

4、设置docker开机自启动

systemctl enable docker
  • 1

5、启动docker后,会新增一个网卡,查看新增的docker网卡

ifconfig
  • 1
[root@lxxxxxxxQ webstack_etc]# ifconfig
br-0e5814797a8f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 111.11.0.1  netmask 255.255.0.0  broadcast 111.11.255.255
        inet6 fe80::42:9ff:feda:e418  prefixlen 64  scopeid 0x20<link>
        ether 01:41:01:da:e1:11  txqueuelen 0  (Ethernet)
        RX packets 11733900  bytes 4344606035 (4.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12783653  bytes 3983865718 (3.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 111.11.0.1  netmask 255.255.0.0  broadcast 111.11.255.255
        ether 01:41:d5:1d:22:c1  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

二、配置webstack

6、创建操作的根目录

mkdir /root/webstack
  • 1

7、进入创建好的根目录,上传启动配置
配置下载地址:webstack_etc
在这里插入图片描述

[root@lsxxxxxxxwQ ~]# cd /root/webstack/
[root@lsxxxxxxxwQ webstack]# ll
total 12
drwxr-xr-x 2 root root 4096 Aug 25 14:04 webstack_etc
-rw-r--r-- 1 root root 2211 Aug 22 10:35 webstack_etc.zip
  • 1
  • 2
  • 3
  • 4
  • 5

三、安装docker-compose

8、先用yum安装pip3

yum install python3-pip
  • 1

9、再用pip3安装docker-compose

pip3 install docker-compose
  • 1

四、用docker-compose启动webstack

10、进入webstack配置文件目录/root/webstack/webstack_etc,使用docker-compose,启动webstack
(启动webstack网站,首次启动需要从docker hub中下载到本地,会有些慢)

cd /root/webstack/webstack_etc
  • 1
docker-compose up -d
  • 1

11、检查是容器否启动
#查看docker下所有的镜像docker images

[root@lsxxxxxxwQ webstack_etc]# docker images
REPOSITORY                   TAG       IMAGE ID       CREATED         SIZE
arvon2014/webstack-laravel   v1.2.2    3826aa52f020   11 months ago   181MB
mysql/mysql-server           5.6       8c587c89edee   20 months ago   238MB
redis                        3         87856cc39862   3 years ago     76MB
  • 1
  • 2
  • 3
  • 4
  • 5

#查看一下容器是否启动docker ps

[root@lxxxxxxxwQ webstack_etc]# docker ps
CONTAINER ID   IMAGE                               COMMAND                  CREATED       STATUS                  PORTS                                       NAMES
18c9494183f6   arvon2014/webstack-laravel:v1.2.2   "/sbin/tini -- /entr…"   4 weeks ago   Up 4 weeks              0.0.0.0:8000->8000/tcp, :::8000->8000/tcp   wsl
0e1a9d6aa3bb   redis:3                             "docker-entrypoint.s…"   4 weeks ago   Up 4 weeks              6379/tcp                                    redis_wsl
019f7bbf30bf   mysql/mysql-server:5.6              "/entrypoint.sh --de…"   4 weeks ago   Up 11 hours (healthy)   3306/tcp                                    mysql_wsl
  • 1
  • 2
  • 3
  • 4
  • 5

五、访问webstack

12、访问webstack这个网站
#webstack首页
192.168.1.198:8000 #端口号默认是8000
在这里插入图片描述

13、访问webstack的后台管理页面
192.168.1.198:8000/admin #端口号默认是8000
在这里插入图片描述


我的报错解决记录(仅用于自己查看)

  370  root 2022/08/22 14:33:23 cd PyNaCl-1.4.0/
  371  root 2022/08/22 14:33:23 ll
  374  root 2022/08/22 14:33:53 make
  375  root 2022/08/22 14:33:58 make install
  376  root 2022/08/22 14:34:47 python3 setup.py build
  377  root 2022/08/22 14:50:04 yum -y install python3-devel
  378  root 2022/08/22 14:50:32 history
  379  root 2022/08/22 14:50:52 pip3 install pynacl
  382  root 2022/08/22 15:06:06 fully installed pynacl-1.5.0
  383  root 2022/08/22 15:31:18 docker-compose
  385  root 2022/08/22 15:32:00 pip3 install docker-compose
  386  root 2022/08/22 15:32:14 ll
  387  root 2022/08/22 15:32:16 cd ../..
  390  root 2022/08/22 15:32:21 ll
  391  root 2022/08/22 15:32:23 cd webstack_etc/
  392  root 2022/08/22 15:32:24 ll
  393  root 2022/08/22 15:33:19 docker-compose up -d
  395  root 2022/08/22 15:40:00 docker images
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/690234
推荐阅读
相关标签
  

闽ICP备14008679号