vsblog
1.0.0
? 最近在學習前後端分離開發模式,為了整合Springboot 與Vue 框架而寫了這個小專案. 帳號: admin
,密碼: iblog.run
.
以下是我在Ubuntu18.04
遠端伺服器上部署vsblog
的流程.
# install jdk
sudo apt install openjdk-8-jdk-headless
# check
java -version
# the installation package as follows you need to download it
# decompress the installation package
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
# update installation package
sudo apt update
# install mysql server
sudo apt install mysql-server
# run mysql
mysql -u root -p
# install redis server
sudo apt-get install redis-server
# check redis server status
netstat -nlt | grep 6379
# test
redis-cli
# mysql -u root -p < vueblog.sql
mysql -u root -p < ' the specified path of database file '
# kill the specified server port:8080
kill -9 $( netstat -nlp | grep :8080 | awk ' {print $7} ' | awk -F " / " ' { print $1 } ' )
# run
# nohup /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -jar /tmp/vueblog-0.0.1-SNAPSHOT.jar > vsblog.file 2>&1 &
nuhup -jar vueblog-0.0.1-SNAPSHOT.jar > vsblog.file 2>&1 &
# test
http://ip:8080/
# first you need install the nginx
sudo apt install nginx
# vim /etc/nginx/nginx.conf
# such as the example configuraion be added as follows
http{
server{
listen 80 ;
server_name vue.iblog.run ;
location / {
proxy_pass http://ip:8080 ;
}
}
}
. . .
# then check the default configuration file
nginx -t
# reload the nginx
nginx -s reload
# test
http://vue.iblog.run
// 自定义全局请求头(后台)
// axios.defaults.baseURL = "http://49.233.79.152:8080"
axios . defaults . baseURL = "http://localhost:8080"
redis - manager :
// host: 49.233.79.152:6379
host : 127.0 .0 .1 : 6379
8.0.11
,如果你的資料庫版本低於它,請修改如下配置pom.xml
: 修改mysql-connector-java 的版本application.yml
: 將driver-class-name 修改為com.mysql.jdbc.Driver詳情請參考我的博文: JDBC-常見錯誤分析