我可以在azure中部署jhipster 5.0.0-beta.0应用程序吗? [英] Can I deploy a jhipster 5.0.0-beta.0 application in azure?

查看:48
本文介绍了我可以在azure中部署jhipster 5.0.0-beta.0应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用jhipster版本5.0.0-beta.0制作的应用程序,我尝试将其作为Web应用程序放置在Azure中,但没有启动

I have an application made with jhipster version 5.0.0-beta.0 and I try to put it in Azure as a web app and did not start

我试图通过FTP进行战争.战争名为ROOT,天蓝色会自动提取它,但应用程序未启动.在本地相同的战争中,我使用以下命令启动它:java -jar root.war --server.port = 9402,它正常启动.在服务器上,我出现错误404,在Azure应用程序日志中,我出现了HTML错误(HTTP错误404.0). 我尝试使用相同的Azure版本(5.0.0-beta.0)生成一个新的应用程序,如该应用程序的核心:

I tried to put the war with FTP. The war is named ROOT, the azure automatically extracts it but the application did not start. On local same war, I start it with the command: java -jar root.war --server.port=9402 and it started normally. On the server, I have error 404 and in the Azure application logs, I have an HTML error (HTTP Error 404.0). I tried to generate a new application like the core of this one with the same azure version (5.0.0-beta.0 ):

我将其放置在具有生成表的同一SQL服务器上的服务器上:jhi_autority,jhy_persistent_autit_event,jhi_persistent_audit_event_data,jhi_redirect_token,jhi_user,jhy_authority,jhy_user_authority. 除jhy_authority,jhi_user和jhy_user_authority外,我已经清空了表. 它在本地开始相同的战争(java -jar root.war --server.port = 9402)并运行,一切正常,在Azure服务器上我无法登录以下请求:/api/authentication和/api/logout请求我收到404错误.

I put it on the server with the connection at the same SQL server where I have this generated tables: jhi_autority,jhy_persistent_autit_event,jhi_persistent_audit_event_data,jhi_redirect_token,jhi_user,jhy_authority, jhy_user_authority. I have emptied tables except for jhy_authority, jhi_user, and jhy_user_authority. Locally same war it starts (java -jar root.war --server.port=9402) and run and all is ok, on the Azure server I can't log in on the requests: /api/authentication and /api/logout request I get a 404 error.

在Azure Web应用程序上,我具有以下配置: -堆栈:Java -Java版本:1.8(自动更新) -Java容器:tomcat -Java容器版本:8.5(自动更新) 平台:32位 -托管管道版本:集成 -http版本:1.1.

On Azure web app, I have this configuration: - stack: java - java version: 1.8(auto-update) - java container: tomcat - java container version: 8.5(auto-update) - platform: 32bit - managed pipeline version: integrated - http version: 1.1.

我也想使此应用程序也能在Azure上正常运行.我尝试在此Web应用程序上上传的其他应用程序是用jhipster 5.8.2生成的,并且使用相同的数据库运行正常. 我不想在此应用程序上更新jhipster,因为我尝试过这样做,但是手动操作我认为这需要数周.

I want to make this app run normally on Azure too. Other applications that I tried to upload on this web app generated with jhipster 5.8.2 and with the same database run ok. I don't want to update the jhipster on this application because I tried that but manually I think it takes weeks.

{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "ro.netgas.admodunet",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "5.0.0-beta.0",
    "baseName": "admodunet",
    "reactive": false,
    "packageName": "ro.netgas.admodunet",
    "packageFolder": "ro/netgas/admodunet",
    "serverPort": "8080",
    "authenticationType": "session",
    "cacheProvider": "ehcache",
    "enableHibernateCache": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "mssql",
    "prodDatabaseType": "mssql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "rememberMeKey": "384b43c544db6d26dae8f8b07d54490cd6eff9aa",
    "clientFramework": "angularX",
    "useSass": true,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "ro"
    ]
  }
}

推荐答案

如果可以通过本地的java -jar root.war --server.port=9402成功运行root.war,则可以按照以下步骤在Azure上部署相同的文件root.war.

If you can run your root.war successfully via java -jar root.war --server.port=9402 on local, you can follow my steps below to deploy the same file root.war on Azure.

这是部署我遵循当前JHipster文档制作的jar文件的步骤.它对我有用.

Here is my steps to deploy a jar file which I followed the current JHipster documents to make. It works for me.

  1. 通过FTP或其他方式将root.war文件上传到Azure WebApp上的路径wwwroot.
  2. 通过FTP或其他方式将名为web.config的文件添加到Azure WebApp上相同路径wwwroot上,web.config内容如下.

  1. Upload your root.war file to the path wwwroot on Azure WebApp via FTP or other ways.
  2. Add a file named web.config to the same path wwwroot on Azure WebApp via FTP or other ways, the web.config content is as below.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
        </handlers>
        <httpPlatform processPath="%ProgramW6432%\Java\jdk1.8.0_60\bin\java.exe" arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar &quot;%HOME%\site\wwwroot\root.war&quot;" stdoutLogEnabled="true" startupRetryCount='10'>
        </httpPlatform>
    </system.webServer>
</configuration>

然后,您需要重新启动WebApp并尝试浏览它.然后,您将看到一些名为httpplatform-stdout_xxxxx_2019xxxxxxx.log的日志文件,其内容如下所示,即表示正常工作.

Then, you need to restart your WebApp and try to browser it. And you will see some log files named like httpplatform-stdout_xxxxx_2019xxxxxxx.log and the content likes as below which means to works.

----------------------------------------------------------
    Application 'myapplication' is running! Access URLs:
    Local:      http://localhost:28747/
    External:   http://100.75.228.104:28747/
    Profile(s):     [prod]
----------------------------------------------------------

注意:端口28747由Azure WebApp随机分配,该值来自环境%HTTP_PLATFORM_PORT%.

Note: the port 28747 is random assigned by Azure WebApp, which value is from the environment %HTTP_PLATFORM_PORT%.

这篇关于我可以在azure中部署jhipster 5.0.0-beta.0应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆