2019.7.4下SVN 使用ftp工具(filezilla)和ssh工具(Xshell)项目部署

总结:对10.191.1.1和10.191.1.2使用ftp工具和ssh工具进行项目部署前台配置

Xshell命令行

  1. 重启nginx: systemctl restart openresty
  2. 查看: cat 文件名
  3. 编辑: sudo vi 文件 点i变成insert 删除直接退格就可以
  4. 不保存退出 esc => :q! => 回车
    保存退出 esc => :wq => 回车
  5. 修改下权限 chmod -R 777 /home/wmsu/nginx/html/dist/*
    cd /usr/local/openresty/nginx/html/dist
    chmod 777 *
  6. 删掉一个空文件夹:sudo rm -rf dist1
  7. 移动: sudo mv afile /tmp 把当前目录下的afile移动到/tmp/目录下
    重命名 :sudo mv aflie bfile 将afile重命名为bfile

在这里插入图片描述
下SVN
在这里插入图片描述
在这里插入图片描述
wmsu
123456
在这里插入图片描述
我第一天来,他说让我先跟着测试熟悉项目,然后把项目部署到本机上面,我不会部署啊,露露姐就发了截图给我,拿上截图我还看不懂,下了SVN找见这个文件(要求如下),那些路径都是在哪里,去问宋哥和曹工这些都是啥意思,人家才告我说让我下载ftp和xshell,然后我才下软件去了,命令行百度了好多,往里面套,貌似还不对,然后我就去问宋哥了,平时我一直觉得好像他做的我也能做,然后他在命令行上面敲了一串命令,看的我一愣一愣的,就这还做了个1和2,突然觉得人家好厉害。晚上自己查了一些命令,自己在那操作各种问题,就回来了

要求:

1.将dist.zip解压至dist目录
2.用FTP工具将dist存放至/usr/local/openresty/nginx/html 下
3.修改下权限chmod -R 777 /home/wmsu/nginx/html/dist/*
4.修改nginx配置
添加以下
vi /usr/local/openresty/nginx/conf/nginx.conf
####webapp目录
location / {
         autoindex on;
         autoindex_exact_size off;    
         autoindex_localtime on;
         root /home/wmsu/nginx/html/dist;
         index index.html;
}
 
location /api {
         proxy_pass   http://127.0.0.1:8080/wifi-cms/api;
}
location /websocket {
        proxy_pass http://127.0.0.1:8080/wifi-cms/websocket;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
}

5.重启nginx 
systemctl restart openresty

如何删掉一个文件夹
在这里插入图片描述
右键删除,然后剩下一个文件夹,在Xshell用命令sudo rm -rf dist2可以删掉空文件夹

wmsu@wmsu:~$ cd /usr/local/openresty/nginx/html/
wmsu@wmsu:/usr/local/openresty/nginx/html$ ls
50x.html  ACCfg  a.txt  dist  dist1  ifemedia  index.html  lost+found  media
wmsu@wmsu:/usr/local/openresty/nginx/html$ rm dist
rm: cannot remove 'dist': Is a directory
wmsu@wmsu:/usr/local/openresty/nginx/html$ rm dist1
rm: cannot remove 'dist1': Is a directory
wmsu@wmsu:/usr/local/openresty/nginx/html$ sudo rm dist
[sudo] password for wmsu: 
rm: cannot remove 'dist': Is a directory
wmsu@wmsu:/usr/local/openresty/nginx/html$ cd dist
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  ?汾.txt
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ rm -r dist
rm: cannot remove 'dist': No such file or directory
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ cd ..
wmsu@wmsu:/usr/local/openresty/nginx/html$ ls
50x.html  ACCfg  a.txt  dist  dist1  ifemedia  index.html  lost+found  media
wmsu@wmsu:/usr/local/openresty/nginx/html$ rm dist
rm: cannot remove 'dist': Is a directory
wmsu@wmsu:/usr/local/openresty/nginx/html$ sudo rm dist
rm: cannot remove 'dist': Is a directory
wmsu@wmsu:/usr/local/openresty/nginx/html$ cd dist
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ ls
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ chmod 777 *
chmod: cannot access '*': No such file or directory
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ cd ..
wmsu@wmsu:/usr/local/openresty/nginx/html$ mv dist dist2
mv: cannot move 'dist' to 'dist2': Permission denied
wmsu@wmsu:/usr/local/openresty/nginx/html$ sudo mv dist dist2
wmsu@wmsu:/usr/local/openresty/nginx/html$ ls
50x.html  ACCfg  a.txt  dist1  dist2  ifemedia  index.html  lost+found  media
wmsu@wmsu:/usr/local/openresty/nginx/html$ cd ~
wmsu@wmsu:~$ ls
0                        ftp_upload_log.sh  nwmsucms.war             telnet.cap   unzip60.tar.gz
admin                    html               OpenResty                telnet_curl  vac_cfg_3.00.01.deb
backup.cfg               JDK                outerConfig.properties   test_bin     vac_relay
daemontools-0.76.tar.gz  msu-verC           p                        test.sh      wlan-2.cfg
deb_repo                 myredirect.lua     pelinux_amd64_80.tar.gz  test_telnet  WMSUBit_3.00.02.deb
dhcp.pcap                nwebapp            pelnx_670.tar.gz         tomcat       WMSUBit.sh
dist                     nwebapp.sh         snapshot                 unzip60
wmsu@wmsu:~$ cd /home/wmsu
wmsu@wmsu:~$ ls
0                        ftp_upload_log.sh  nwmsucms.war             telnet.cap   unzip60.tar.gz
admin                    html               OpenResty                telnet_curl  vac_cfg_3.00.01.deb
backup.cfg               JDK                outerConfig.properties   test_bin     vac_relay
daemontools-0.76.tar.gz  msu-verC           p                        test.sh      wlan-2.cfg
deb_repo                 myredirect.lua     pelinux_amd64_80.tar.gz  test_telnet  WMSUBit_3.00.02.deb
dhcp.pcap                nwebapp            pelnx_670.tar.gz         tomcat       WMSUBit.sh
dist                     nwebapp.sh         snapshot                 unzip60

wmsu@wmsu:~$ sudo mv dist /usr/local/openresty/nginx/html
wmsu@wmsu:~$ cd /usr/local/openresty/nginx/html
wmsu@wmsu:/usr/local/openresty/nginx/html$ ls
50x.html  ACCfg  a.txt  dist  dist1  dist2  ifemedia  index.html  lost+found  media
wmsu@wmsu:/usr/local/openresty/nginx/html$ cd dist
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ chmod 777 *
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  version.txt
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ vi /usr/local/openresty/nginx/conf/nginx.conf
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ systemctl restart openresty
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'openresty.service'.
Authenticating as: wmsu,,, (wmsu)
Password: 
==== AUTHENTICATION COMPLETE ===
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ cd ..
wmsu@wmsu:/usr/local/openresty/nginx/html$ ls
50x.html  ACCfg  a.txt  dist  dist1  dist2  ifemedia  index.html  lost+found  media
wmsu@wmsu:/usr/local/openresty/nginx/html$ rm -rf dist1
rm: cannot remove 'dist1': Permission denied
wmsu@wmsu:/usr/local/openresty/nginx/html$ sudo rm -rf dist1
wmsu@wmsu:/usr/local/openresty/nginx/html$ ls
50x.html  ACCfg  a.txt  dist  dist2  ifemedia  index.html  lost+found  media
wmsu@wmsu:/usr/local/openresty/nginx/html$ sudo rm -rf dist2
wmsu@wmsu:/usr/local/openresty/nginx/html$ ls
50x.html  ACCfg  a.txt  dist  ifemedia  index.html  lost+found  media

在这里插入图片描述
ftp怎么上传文件到服务器上?

在左侧点击下拉框,打开要上传文件所在的目录。
右击要上传的文件,选择“传输”,就会自动传到服务器目录上了

原来目录没有权限
得打开home底下的wmsu上传成功,移过去

上传时先备份
远程站点的文件如何移动?

下载一个Xshell
在这里插入图片描述

 \\172.16.30.11\share

yanfengting
123456
在这里插入图片描述
在这里插入图片描述
点击左上角的新建,然后出来服务器信息页面,在这里需要填写的是:

  1. 连接名称
  2. 服务器IP
  3. 服务器端口(默认22)

填写完毕后,点击确定,保存配置,回到连接页面,可以看到多了一个测试服务器的连接。
完整:https://jingyan.baidu.com/article/e75057f210c6dcebc91a89dd.html
在这里插入图片描述
详细步骤:10.191.1.2

sudo -i
[sudo] password for wmsu: 
root@wmsu:~# cd /usr/local/openresty/nginx/html/
root@wmsu:/usr/local/openresty/nginx/html# ls
dist  dist1  lost+found
root@wmsu:/usr/local/openresty/nginx/html# cd dist
root@wmsu:/usr/local/openresty/nginx/html/dist# ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  ?汾.txt
root@wmsu:/usr/local/openresty/nginx/html/dist# chmod 777 *
root@wmsu:/usr/local/openresty/nginx/html/dist# ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  ?汾.txt

root@wmsu:/usr/local/openresty/nginx/html/dist# cd /usr/local/openresty/nginx/conf
root@wmsu:/usr/local/openresty/nginx/conf# ls
fastcgi.conf            koi-utf             nginx.conf           uwsgi_params
fastcgi.conf.default    koi-win             nginx.conf.default   uwsgi_params.default
fastcgi_params          mime.types          scgi_params          win-utf
fastcgi_params.default  mime.types.default  scgi_params.default
root@wmsu:/usr/local/openresty/nginx/conf# vi nginx.conf

在这里插入图片描述
systemctl restart openresty
在这里插入图片描述
shell命令

命令cd——更改目录
cd ~ 切换到主目录
cd /tmp 切换到目录/tmp
cd dir 切换到当前目录下的dir目录
cd / 切换到根目录
cd .. 切换到到上一级目录
cd ../.. 切换到上二级目录
cd ~ 切换到用户目录,比如是root用户,则切换到/root下

命令mv——移动和重命名文件
mv aflie bfile 将afile重命名为bfile
mv afile /tmp 把当前目录下的afile移动到/tmp/目录下

进入/home/wmsu 把当前目录下的dist移动到/usr/local/openresty/nginx/html目录下
cd /home/wmsu 切换到目录/tmp
mv dist /usr/local/openresty/nginx/html/

cp dist /home/bible/ 把文件dist从当前目录复制到/home/bible/目录下

sudo mv dist dist1 修改/usr/local/openresty/nginx/html下的dist为dist1
在这里插入图片描述
ls
sudo -i 为了频繁的执行某些只有超级用户才能执行的权限,而不用每次输入密码,可以使用该命令。提示输入密码时该密码为当前账户的密码。没有时间限制。执行该命令后提示符变为“#”而不是“$”。想退回普通账户时可以执行“exit”或“logout” 。

wmsu@wmsu:~$ ls
0       endpoint  mytelnet  pelinux       smartmontools_5.41.deb  test_telnet     vac_relay
Common  ixia.cap  nginx02   ping_1.cap    sql                     test_telnet2    wlan-2.cfg
dist    Master    Packages  restoreSW.sh  telnet_demo.py          test_telnet.py  WMSUBit_3.00.02.deb
wmsu@wmsu:~$ sudo -i
[sudo] password for wmsu: 

进入目录  /usr/local/openresty/nginx/html/
root@wmsu:/home/wmsu# cd /usr/local/openresty/nginx/html/
root@wmsu:/usr/local/openresty/nginx/html# ls
dist  lost+found
root@wmsu:/usr/local/openresty/nginx/html# cd dist/
root@wmsu:/usr/local/openresty/nginx/html/dist# ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  ?汾.txt

进入目录/home/wmsu/
root@wmsu:/usr/local/openresty/nginx/html/dist# cd /home/wmsu/
root@wmsu:/home/wmsu# ls
0       endpoint  mytelnet  pelinux       smartmontools_5.41.deb  test_telnet     vac_relay
Common  ixia.cap  nginx02   ping_1.cap    sql                     test_telnet2    wlan-2.cfg
dist    Master    Packages  restoreSW.sh  telnet_demo.py          test_telnet.py  WMSUBit_3.00.02.deb
root@wmsu:/home/wmsu# cd dist/
root@wmsu:/home/wmsu/dist# ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  ?汾.txt
root@wmsu:/home/wmsu/dist# cd /usr/local/openresty/nginx/html/
root@wmsu:/usr/local/openresty/nginx/html# ls
dist  lost+found
root@wmsu:/usr/local/openresty/nginx/html# mv dist/ dist1
root@wmsu:/usr/local/openresty/nginx/html# ls
dist1  lost+found
root@wmsu:/usr/local/openresty/nginx/html# cd /home/wmsu/

root@wmsu:/home/wmsu# mv dist/ /usr/local/openresty/nginx/html/

root@wmsu:/home/wmsu# cd /usr/local/openresty/nginx/html/
root@wmsu:/usr/local/openresty/nginx/html# ls
dist  dist1  lost+found
root@wmsu:/usr/local/openresty/nginx/html# rm dist1/
rm: cannot remove 'dist1/': Is a directory

root@wmsu:/usr/local/openresty/nginx/html# cd dist1
root@wmsu:/usr/local/openresty/nginx/html/dist1# ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  ?汾.txt
root@wmsu:/usr/local/openresty/nginx/html/dist1# rm turn.min.js 
root@wmsu:/usr/local/openresty/nginx/html/dist1# l
css/  favicon.ico  fonts/  img/  index.html  jquery.min.1.7.js  js/  ?汾.txt
root@wmsu:/usr/local/openresty/nginx/html/dist1# rm *
rm: cannot remove 'css': Is a directory
rm: cannot remove 'fonts': Is a directory
rm: cannot remove 'img': Is a directory
rm: cannot remove 'js': Is a directory

root@wmsu:/usr/local/openresty/nginx/html/dist1# ls
css  fonts  img  js
root@wmsu:/usr/local/openresty/nginx/html/dist1# cd ..
root@wmsu:/usr/local/openresty/nginx/html# ls
dist  dist1  lost+found
root@wmsu:/usr/local/openresty/nginx/html# rm dist1
rm: cannot remove 'dist1': Is a directory

root@wmsu:/usr/local/openresty/nginx/html# cd dist
root@wmsu:/usr/local/openresty/nginx/html/dist# ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  ?汾.txt
root@wmsu:/usr/local/openresty/nginx/html/dist# chmod 777 *
root@wmsu:/usr/local/openresty/nginx/html/dist# ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  ?汾.txt
root@wmsu:/usr/local/openresty/nginx/html/dist# 

修改下权限 chmod -R 777 /home/wmsu/nginx/html/dist/*
cd /usr/local/openresty/nginx/html/dist
chmod 777 *

没修改以前是 /home/wmsu/nginx/html/dist/*
修改了以后是 cd /usr/local/openresty/nginx/html/dist
绿色的是有权限的

wmsu@wmsu:~$ cd /home/wmsu/nginx/html/dist/
-bash: cd: /home/wmsu/nginx/html/dist/: No such file or directory
wmsu@wmsu:~$ cd /home/wmsu
wmsu@wmsu:~$ ls
0         ixia.cap  nginx02   ping_1.cap              sql             test_telnet2    wlan-2.cfg
Common    Master    Packages  restoreSW.sh            telnet_demo.py  test_telnet.py  WMSUBit_3.00.02.deb
endpoint  mytelnet  pelinux   smartmontools_5.41.deb  test_telnet     vac_relay  
wmsu@wmsu:~$ cd /usr/local/openresty/nginx/html/
wmsu@wmsu:/usr/local/openresty/nginx/html$ ls
dist  dist1  lost+found
wmsu@wmsu:/usr/local/openresty/nginx/html$ cd dist
wmsu@wmsu:/usr/local/openresty/nginx/html/dist$ ls
css  favicon.ico  fonts  img  index.html  jquery.min.1.7.js  js  turn.min.js  ?汾.txt

4 cat 文件名 //查看
sudo vi 文件 //点i变成insert 删除直接退格就可以
不保存退出 esc => :q! => 回车
保存退出 esc => :wq => 回车
在这里插入图片描述
5 重启nginx
systemctl restart openresty

wmsu@wmsu:/usr/local/openresty/nginx/conf$ systemctl restart openresty
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'openresty.service'.
Authenticating as: wmsu,,, (wmsu)
Password: 
==== AUTHENTICATION COMPLETE ===

在这里插入图片描述
后面这个10.191.1.2连不上了
是因为我当时修改了权限
全改成chmod 777 *

在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/fengtingYan/article/details/94622827