线上商城系统

[root@localhost ~]# cp /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.bak
[root@localhost ~]# grep -Ev "#|^$" /usr/local/nginx/conf/nginx.conf.bak > /usr/local/nginx/conf/nginx.conf
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
server {
           listen    80;
           server_name     www.feng.com;
           root            /feng;
           location / {
                      index  index.html;
                }
       }
  server {
        listen       80;
        server_name  localhost;
        location / {
              root    html;
              index index.html;
        }
        location /status {
                     stub_status   on;
                     access_log    off;
}

[root@localhost ~]# mkdir /feng
[root@localhost ~]# /usr/local/nginx/sbin/nginx
[root@localhost ~]# echo "wuliao" > /feng/index.html
[root@localhost ~]# vim /etc/hosts
192.168.1.30 www.feng.com
[root@localhost ~]# curl www.feng.com
wuliao

上线一个静态的前端系统(商城系统)
[root@www ~]# wget https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm
[root@www ~]# yum -y install epel-release-7-14.noarch.rpm 
[root@www ~]# yum list | grep nodejs
[root@www ~]# yum -y install nodejs.x86_64
[root@www ~]# yum -y install npm
[root@www ~]# npm config set registry https://registry.npmmirror.com
[root@www ~]# npm install  @vue/cli 
[root@www ~]# ls -l /root/node_modules/.bin/vue
lrwxrwxrwx. 1 root root 22 7月  31 14:39 /root/node_modules/.bin/vue -> ../@vue/cli/bin/vue.js
[root@www ~]# /root/node_modules/.bin/vue -V
@vue/cli 5.0.8
[root@www ~]# /root/node_modules/.bin/vue create eleme_web
[root@www ~]# cd eleme_web/
[root@www eleme_web]# npm run serve
浏览器访问: http://192.168.1.30:8080/


[root@www eleme_web]# yum -y install samba
[root@www eleme_web]# vim /etc/samba/smb.conf
[eleme_web]
        comment=fengye
        path=/root/eleme_web
        guest ok=no
        writable=yes
[root@www eleme_web]# useradd vueediter
[root@www eleme_web]# smbpasswd -a vueediter
New SMB password:1
Retype new SMB password:1
Added user vueediter.
[root@www eleme_web]# setfacl -m u:vueediter:rwx /root/eleme_web/
[root@www eleme_web]# systemctl start nmb
[root@www eleme_web]# systemctl start smb
[root@www eleme_web]# mkdir public/img
[root@www eleme_web]# mkdir public/vedeo
[root@www eleme_web]# mkdir public/music
部署nfs服务器
[root@cang ~]# yum -y  install rpcbind
[root@cang ~]# yum -y install nfs-utils
[root@cang ~]# vim /etc/exports
/static/img/               *(rw,sync)
[root@cang ~]# mkdir -p /static/img/
[root@cang ~]# systemctl start rpcbind
[root@cang ~]# systemctl start nfs
服务端
[root@www eleme_web]# yum -y install nfs-utils
[root@www eleme_web]# mount -t nfs 192.168.1.15:/static/img public/img/
nfs服务器
[root@cang ~]# ls /static/img/
tupian.png
服务端
[root@www eleme_web]# ls public/img/
tupian.png
[root@www eleme_web]# cd src/
[root@www src]# cd views/
[root@www views]# vim HomeView.vue
<img alt="Vue logo" src="img/tupian.png">
浏览器访问

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值