一、打包出現問題
後經發現是因為maven的打包外掛的版本問題,需要修改版本
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<!--在這裡修改版本-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!---->
</plugins>
二、使用nohup後臺
nohup java -jar *******.jar &
1、nohup: ignoring input and appending output to ‘nohup.out’
他的意思是,之後會直接忽略輸入,並且會把輸出(日誌)寫在nohup.out檔案中
2、tail -f nohup.out
這個指令可以觀看nohup.out檔案具體內容
3、jobs -l
檢視全部nuhup正在執行的任務
4、kill -9 任務對應號碼
關閉任務
三、nginx負責的轉發
#springboot測試均衡池
upstream boot_pool{
# 注意這裡要先開放8080埠
server 101.34.51.129:8080;
}
server
{
listen 88;
server_name coderwang.exploit365.cn;
index index.html index.htm index.php;
root /www/server/phpmyadmin;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /www/wwwlogs/access.log;
}
#Demo2埠轉發
server {
# 這個地方要監視80埠
listen 80;
server_name coderwang.exploit365.cn;
access_log logs/movie.log;
error_log logs/movie.error;
#將所有請求轉發給demo_pool池的應用處理
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://boot_pool;
}
}