gpt4 book ai didi

spring-boot - 将示例 springboot 应用程序 (WebGoat) 部署到 Azure 应用程序服务

转载 作者:行者123 更新时间:2023-12-03 00:21:45 24 4
gpt4 key购买 nike

Azure 应用服务新功能,关注 https://learn.microsoft.com/en-us/azure/app-service/quickstart-java?tabs=javase&pivots=platform-linux ,我正在尝试将WebGoat部署到Azure App,但不成功。

git clone https://github.com/WebGoat/WebGoat
cd WebGoat
git checkout v8.0.0.M26
mvn install -T 4 -Dmaven.test.skip=true -DskipTests
cd webgoat-server

//here I could deploy the jar locally with
//$java -jar target/webgoat-server-v8.0.0.M26.jar
//and see the site at localhost:8080/WebGoat

//now trying to deploy to azure using Azure maven plguin
mvn com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config
vim pom.xml //as per below
mvn package azure-webapp:deploy

我的 webgoat-server/pom.xml

     <plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>1.14.0</version>
<configuration>
<schemaVersion>v2</schemaVersion>
<subscriptionId>0665bd88-599e-4153-887a-2c51c3e094d0</subscriptionId>
<resourceGroup>webgoat-server-1620910221297-rg</resourceGroup>
<appName>webgoat-server-1620910221297</appName>
<pricingTier>F1</pricingTier>
<region>westeurope</region>
<runtime>
<os>Linux</os>
<javaVersion>Java 11</javaVersion>
<webContainer>Java SE</webContainer>
</runtime>
<deployment>
<resources>
<resource>
<directory>${project.basedir}/target</directory>
<includes>
<include>webgoat-server-v8.0.0.M26.jar</include>
</includes>
</resource>
</resources>
</deployment>
</configuration>

我从 azure 应用服务获得了什么 |日志流,

2021-05-13T13:03:30.937769935Z: [INFO]  2021-05-13 13:03:30.937  INFO 124 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2021-05-13T13:03:33.564912852Z: [INFO] 2021-05-13 13:03:33.564 INFO 124 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2021-05-13T13:03:34.138847510Z: [INFO] 2021-05-13 13:03:34.138 INFO 124 --- [ main] io.undertow : starting server: Undertow - 2.0.27.Final
2021-05-13T13:03:34.205034948Z: [INFO] 2021-05-13 13:03:34.204 INFO 124 --- [ main] org.xnio : XNIO version 3.3.8.Final
2021-05-13T13:03:34.295912450Z: [INFO] 2021-05-13 13:03:34.295 INFO 124 --- [ main] org.xnio.nio : XNIO NIO Implementation Version 3.3.8.Final
2021-05-13T13:03:34.383176472Z: [ERROR] WARNING: An illegal reflective access operation has occurred
2021-05-13T13:03:34.383264172Z: [ERROR] WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (jar:file:/local/site/wwwroot/app.jar!/BOOT-INF/lib/xnio-nio-3.3.8.Final.jar!/) to constructor sun.nio.ch.EPollSelectorProvider()
2021-05-13T13:03:34.383276972Z: [ERROR] WARNING: Please consider reporting this to the maintainers of org.xnio.nio.NioXnio$2
2021-05-13T13:03:34.383281572Z: [ERROR] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
2021-05-13T13:03:34.384696864Z: [ERROR] WARNING: All illegal access operations will be denied in a future release
2021-05-13T13:03:36.058791199Z: [INFO] 2021-05-13 13:03:36.058 INFO 124 --- [ main] o.s.b.w.e.u.UndertowServletWebServer : Undertow started on port(s) 80 (http) with context path '/WebGoat'
2021-05-13T13:03:36.159459348Z: [INFO] 2021-05-13 13:03:36.158 INFO 124 --- [ main] org.owasp.webgoat.StartWebGoat : Started StartWebGoat in 90.144 seconds (JVM running for 106.368)
2021-05-13T13:05:29 No new trace in the past 1 min(s).
2021-05-13T13:06:29 No new trace in the past 2 min(s).
2021-05-13T13:07:29 No new trace in the past 3 min(s).

来自浏览器,

导航至 https://webgoat-server-1620910221297.azurewebsites.net/

502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

导航至 https://webgoat-server-1620910221297.azurewebsites.net/WebGoat

:( Application Error
If you are the application administrator, you can access the diagnostic resources.

是否需要执行任何其他步骤来公开端口 8080 和路径/WebGoat?

最佳答案

要在应用服务上公开端口 8080,请参阅 this thread .

至于路径,您应该将应用程序安装在site/home/wwwroot下。检查配置 -> 路径映射以查看虚拟目录。

关于spring-boot - 将示例 springboot 应用程序 (WebGoat) 部署到 Azure 应用程序服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67520170/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com