上线一个商城系统

上线一个商城系统

[root@server1 ~]# yum -y install nodejs

[root@server1 ~]# node -v

v16.20.2

[root@server1 ~]# yum -y install npm

[root@server1 ~]# npm -v

8.19.4

[root@server1 ~]# npm config set registry https://registry.npmmirror.com

[root@server1 ~]# npm install @vue/cli

[root@server1 ~]# find / -name "vue"

/root/vuehtm1000/node_modules/vue

/root/node_modules/vue

/root/node_modules/.bin/vue

/usr/local/bin/vue、

/usr/local/lib/node_modules/@vue/cli/node_modules/vue

[root@server1 ~]# ls -l /root/node_modules/.bin/vue

lrwxrwxrwx 1 root root 22 7月  31 14:41 /root/node_modules/.bin/vue -> ../@vue/cli/bin/vue.js

[root@server1 ~]# /root/node_modules/.bin/vue -V               //查看版本号

@vue/cli 5.0.8

[root@server1 ~]# /root/node_modules/.bin/vue create tdr_web                //创建vue项目

[root@server1 ~]# cd tdr_web/

[root@server1 tdr_web]# npm run serve

[root@server1 tdr_web]# nohup npm run serve&

[root@server1 tdr_web]# fg                //将后台作业切换到前台运行,fg命令的基本语法是 fg [作业编号]。作业编号是作业在后台运行时系统所分配的数字标识符。如果不指定作业编号,fg命令将切换到最近的后台作业。‌

nohup npm run serve

^C                              //使用ctrl+c退出

[root@server1 tdr_web]# fg

-bash: fg: 当前: 无此任务

[root@server1 tdr_web]# pwd

/root/tdr_web

[root@server1 tdr_web]# yum -y install samba

[root@server1 tdr_web]# vim /etc/samba/smb.conf

[tdr_web]

        comment=tdr

        path=/root/tdr_web

        guest ok=no

        writable=yes

创建用户:

[root@server1 tdr_web]# useradd vueediter

[root@server1 tdr_web]# smbpasswd -a vueediter

New SMB password:

Retype new SMB password:

Added user vueediter.

为该用户在文件夹中添加读写权限

[root@server1 tdr_web]# setfacl -m u:vueediter:rwx /root/tdr_web/

[root@server1 tdr_web]# systemctl restart nmb

[root@server1 tdr_web]# systemctl restart smb

去windows系统连接

[root@server1 tdr_web]# mkdir public/img

[root@server1 tdr_web]# mkdir public/video

[root@server1 tdr_web]# mkdir public/music

[root@server1 tdr_web]# tree public/

public/

├── favicon.ico

├── img

├── index.html

├── music

└── video

3 directories, 2 files

[root@server1 tdr_web]#

创建一台新机子

[root@server2 ~]# yum -y install rpcbind

[root@server2 ~]# yum -y install nfs-utils

[root@server2 ~]# vim /etc/exports

/static/img/ (*rw,sync)

[root@server2 ~]# mkdir -p /static/img

[root@server2 ~]# systemctl start rpcbind

[root@server2 ~]# systemctl start nfs

[root@server2 ~]# systemctl stop firewalld

回到server1

[root@server1 tdr_web]# yum -y install nfs-utils

[root@server1 tdr_web]# yum -y install rpcbind

[root@server1 tdr_web]# mount -t nfs 192.168.1.125:/static/img public/img/

去server2

[root@server2 ~]# cd /static/img/

[root@server2 img]# rz -E                  //放张图片进去

rz waiting to receive.

查看

[root@server1 tdr_web]# ls public/img/

tdr.png

[root@server1 tdr_web]# cd src

[root@server1 src]# ls

App.vue  assets  components  main.js  router  store  views

[root@server1 src]# cd components/

[root@server1 components]# ls

HelloWorld.vue

[root@server1 components]# cd ..

[root@server1 src]# cd views/

[root@server1 views]# ls

AboutView.vue  HomeView.vue

[root@server1 views]# vim src/views/HomeView.vue

<template>

  <div class="home">

    <img alt="Vue logo" src="img/tdr.png">

    <HelloWorld msg="Welcome to Your Vue.js App"/>

  </div>

</template>

<script>

// @ is an alias to /src

import HelloWorld from '@/components/HelloWorld.vue'

export default {

  name: 'HomeView',

  components: {

    HelloWorld

  }

}

</script>

[root@server1 views]# cd ..

[root@server1 src]# cd ..

[root@server1 tdr_web]# npm run serve

浏览器访问:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值