1、官網:https://www.virtualbox.org/
然后呢,點擊下載:
開始安裝virtualbox:
雙擊安裝。詳細安裝過程見:https://baijiahao.baidu.com/s?id=1617088883237334113&wfr=spider&for=pc
點擊下一步:
開始安裝
選擇自己的安裝目錄即可:
然后默認,下一步:
默認是。
默認安裝:
最后選擇,完成就完成了安裝。
安裝好,打開以后是這個鳥樣:
話說還是比較喜歡Vmware虛擬機。
至此,可以使用VirtualBox創建虛擬機並安裝操作系統了。由於在學習基於SpringBoot的點餐系統,慕課網的一個系統,沒辦法,先安裝一個試試玩唄。
2、開始創建一個虛擬機。剛才說了,學習慕課網的一個教程,直接使用他們的鏡像(里面配置好了一些環境,比如Nginx,apache,mysql等等吧)。
然后就進入了導入鏡像的設置了;
然后等待一定的時間即可:
導入成功以后,然后點擊啟動:
點擊啟動,然額我的報錯了:
先說一下如何將鼠標退出virtualbox軟件吧,有點讓人絕望的事情。默認是按右Ctrl鍵(就是鍵盤右邊的那個Ctrl鍵)就退出來了,很操蛋的操作啊。還是修改為Vmware的alt+ctrl鍵吧。如果要修改這個退出的按鍵,點擊管理,點擊全局。
然后主機和Virtualbox里面的虛擬機不能拷貝和粘貼,真心不好使啊,煩的一比。
設備里面共享粘貼板里面,勾選雙向還是不好使,感覺這個軟件垃圾的一筆啊。
復制粘貼功能,還有安裝增強功能還沒有弄好,以后再弄吧,真費勁。先把網絡調通。
由於鏈接的無線網絡,所以這里配置了橋接模式,讓網絡互通。
上面新增的虛擬網卡,就是默認的我也沒有修改,之前使用Vmware習慣使用Nat8,但是VirtualBox是橋接模式,自己可以視情況而定吧。
互ping一下,看看網絡情況。
然后用自己最順手的Xshell連上這個虛擬機,嗯,真舒服。用virtualbox真惡心。嗯,就這樣子。
3、鏈接:https://pan.baidu.com/s/1w14PLYKMM9Cb3Fo-OyA96w 密碼:bvqd。下載自己所需的centos7.3.ova鏡像。
因為這個里面已經安裝好了一些軟件,這樣你學習Spring Boot企業微信點餐系統,時間成本較小些(當然對於沒有花money來弄得小伙伴)。
4、Spring Boot企業微信點餐系統。
當你的買家商品信息查詢出來的時候,廖老師說將和前端聯合起來,這個時候就用到了上面所安裝的虛擬機,tmd,搞了一天虛擬機,真的心累。
一閃而過。跳轉到了微信客戶端,前端做了一層邏輯,如果Cookie少了openid的值,就進行了跳轉。
查看Cookie的信息:
再次訪問虛擬機地址即可:
修改一下Nginx的配置,完成將自己的商品信息查詢出來的功能。
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
完整配置如下所示:
1 [root@localhost ~]# cat /usr/local/nginx/conf/nginx.conf 2 3 #user nobody; 4 worker_processes 1; 5 6 #error_log logs/error.log; 7 #error_log logs/error.log notice; 8 #error_log logs/error.log info; 9 10 #pid logs/nginx.pid; 11 12 13 events { 14 worker_connections 1024; 15 } 16 17 18 http { 19 include mime.types; 20 default_type application/octet-stream; 21 22 #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 23 # '$status $body_bytes_sent "$http_referer" ' 24 # '"$http_user_agent" "$http_x_forwarded_for"'; 25 26 #access_log logs/access.log main; 27 28 sendfile on; 29 #tcp_nopush on; 30 31 #keepalive_timeout 0; 32 keepalive_timeout 65; 33 34 #gzip on; 35 server { 36 listen 80; 37 server_name localhost; 38 39 #charset koi8-r; 40 41 #access_log logs/host.access.log main; 42 43 location / { 44 root /opt/data/wwwroot/sell; 45 index index.html index.htm; 46 } 47 location /sell/ { 48 proxy_pass http://127.0.0.1:8080/sell/; 49 } 50 51 #error_page 404 /404.html; 52 53 # redirect server error pages to the static page /50x.html 54 # 55 error_page 500 502 503 504 /50x.html; 56 location = /50x.html { 57 root html; 58 } 59 60 # proxy the PHP scripts to Apache listening on 127.0.0.1:80 61 # 62 #location ~ \.php$ { 63 # proxy_pass http://127.0.0.1; 64 #} 65 66 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 67 # 68 #location ~ \.php$ { 69 # root html; 70 # fastcgi_pass 127.0.0.1:9000; 71 # fastcgi_index index.php; 72 # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 73 # include fastcgi_params; 74 #} 75 76 # deny access to .htaccess files, if Apache's document root 77 # concurs with nginx's one 78 # 79 #location ~ /\.ht { 80 # deny all; 81 #} 82 } 83 84 85 # another virtual host using mix of IP-, name-, and port-based configuration 86 # 87 #server { 88 # listen 8000; 89 # listen somename:8080; 90 # server_name somename alias another.alias; 91 92 # location / { 93 # root html; 94 # index index.html index.htm; 95 # } 96 #} 97 98 99 # HTTPS server 100 # 101 #server { 102 # listen 443 ssl; 103 # server_name localhost; 104 105 # ssl_certificate cert.pem; 106 # ssl_certificate_key cert.key; 107 108 # ssl_session_cache shared:SSL:1m; 109 # ssl_session_timeout 5m; 110 111 # ssl_ciphers HIGH:!aNULL:!MD5; 112 # ssl_prefer_server_ciphers on; 113 114 # location / { 115 # root html; 116 # index index.html index.htm; 117 # } 118 #} 119 120 }
修改配置如下所示:
修改為自己電腦所在的ip地址即可。
修改完畢以后重啟一下,[root@localhost ~]# nginx -s reload
如果你有內網,有外網,最好將外網的網絡設置為手動的,不要使用動態ip,不讓網段會發生改變,還是蠻麻煩的。
修改為域名訪問,修改完畢以后進行刷新即可:
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
[root@localhost ~]# nginx -s reload
將172.16.3.155 sell.com添加到C:\Windows\System32\drivers\etc
然后又遇到一些奇葩問題,先搞到這里吧,有問題見下篇或者再記錄吧。
待續......