Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to conduct web access to xen and console analysis

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

How to conduct web access xen and console analysis, I believe that many inexperienced people are helpless about this, this article summarizes the causes and solutions of the problem, through this article I hope you can solve this problem.

basic concepts

Understanding basic concepts helps us search queries

xen:hypervisor

xenserver: hypervisor+api+tools (enterprise)

xcp: hypervisor+api+tools (community)

xenapi:The management API exposed by XenServer and XCP.

xapi:The primary daemon on XenServer and Xen Cloud Platform; The one that exposes the XenAPI.

xencenter: client (application), api calls are not supported.

Console flow: client (browser)--xenserver(API): must ensure that the client (browser) and vm host xenserver can communicate directly

sample shows

xapi-console:https://github.com/xapi-project/xen-api

The xapi project is an example of the use of xenapi, which is key. I use the java package source code in the above address. Note that using these source codes requires referencing xenapi dependent jar packages.

1. In addition to the source code in the above address, you need four jar package dependencies: xenserver.jar, ws-commons-util.jar, xmlrpc-client.jar, xmlrpc-common.jar. These packages can be downloaded officially or via the maven library.

2. In addition to the source code in the above address, you need xenapi source code and additional ws-commons-util, xmlrpc-client, xmlrpc-common three jar packages, dependency instructions can refer to the official documentation, download can be through maven library.

Either way, the point is to understand the difference between xapi projects and xenapi projects.

Java source code introduction in the above address, mainly concerned with three java files and an html file, Initialize.java and examples under the two java files, console.html file, which tells us how to reference java applet plug-in, examples under the two java can be run directly to the application, mainly tells us how to get vm, get vm console, how to use VNC to get console stream. Initialize.java is a standard applet, referred to in console.html. You can modify Initialize.java to achieve your desired scenario.

Description of html reference applet: The path of codebase cannot be loaded under WEB-INF;archive defaults to loading the specified package under codebase (the four xapi-related jars and the above xapi-console source package), code is also loaded under codebase by default; the label is a parameter value, html How to pass parameters to applet can be Baidu.

The above basically completes the coding work, the rest is often encountered problems, unable to load and display applets, unable to read xenserver console stream

Unable to load applet

Install the JRE plug-in and add the url to the exception site of the client JRE. Windows control panel-java program-security.

Keep modifying code, codebase, archive content according to error log until it can load button.

Unable to read console stream

Sign the above five jars, and the process is as follows:

Using keytool tool to generate keystore

1. Keytool tool is located in the ${java_home}/bin directory;

2. Execute the command in DOS window: keytool -genkey -keystore mytest.store-alias mbq

Note: mytest.store is the name of your key repository, you can modify it at will, please do not modify the suffix!

If necessary, add DOS command keytool -genkey -keystore mytest.store-alias mbq -validity 3650

-Validity 3650 indicates that the validity period is 3650 days, and the default is six months.

mbq is an alias. This can also be changed to its own name.

3. After executing the above command, the DOS window will prompt you for the keystore password, your name, organizational unit, and so on.

The thing to note here is to enter the password, remember, which will be used later. At the end, we enter y confirmation information.

Then enter directly to set mbq's master password and store password consistent!

Certificate used when exporting signatures using keytool tool

1. Execute the command in DOS window: keytool -export -keystore mytest.store-alias mbq -file mbq.cert

Note: mytest.store is the name of the keystore generated in step 2

mbq is also the alias we specified in the previous step

mbq.cert is the name of the certificate we generated. You can modify the name yourself. Be careful not to change the suffix.

2. If the command succeeds, we will find an mbq.cert file in the current directory, which is the certificate we just generated.

Using jarsigner tool to sign jar compressed documents

1. jarsigner tool is located in ${java_home}/bin directory;

2. Execute command in current DOS window: jarsigner -keystore mytest.store mytest.jar mbq

Note: mytest.store is the name of the keystore we generated in step 2

mytest.jar is the five packages we want to sign.

mbq is the name of the provider, which we set to our alias here

Changes to client-side programs are repackaged and signed.

Create mytest.policy file

1. Create a mytest.policy file in the current directory with the following contents:

keystore"file:mytest.store","JKS";

grantsignedBy"mbq"

{

permission java.io.FilePermission"","read";

};

2. This file means that all applets signed by mbq can read all files locally.

Make sure five signed jar and.policy files,.cert certificate files, and.store keystore files are in the codebase directory.

occasionally blocked by security policies

The reason for this problem has not been found. It may be that the prompt disappears after the browser blocks it. We cannot confirm the permission.

You need to modify/lib/security/java.policy under JRE and add it in grant

permission java.net.SocketPermission "*", "accept, connect, listen, resolve";

permission java.security.AllPermission;

permission java.io.FilePermission "", "read,write";

After reading the above content, do you know how to access xen and console analysis on the web? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report