Customizing the Azure Site Java Runtime Environment (4)

Source: Internet
Author: User

Customize your own version of Tomcat and JDK environment

In the previous section, we described how to customize the default Azure website Java Runtime Environment through Web. config, by default, the Azure site Tomcat is the 7.0.50,java version 1.7.0_ 51, but the Tomcat and Java versions of the user's own test development or production environment are likely to be later versions, can the Azure website be customized in depth, using the user's own Tomcat and Java?

In this section, I'll describe how you can use your own version of TOMCAT,JDK to set the parameters in depth in the PAAs service in Azure website.

  1. First install or download the JDK in your local, this process usually has the Java development experience the developer should already be able to close the eye to do:) I installs in the C drive, uses the Java version is 1.8.0_60 as follows:

  2. Use your FTP tool to connect to your Web site, build a bin subdirectory under the root directory, and upload all the files in your local JDK directory, including the JDK directory, to the bin directory, and the following directory structure is completed:

  3. After uploading the JDK, download tomcat on the Apache website, as Azure is using Tomcat7.0.50, in this test we download Tomcat 8.0 and unzip it locally:

  4. In Azure's website PAAs service, the tomcat you've customized is actually placed in a managed environment, so you need to do some customization before you upload, open the Server.xml file in your tomcat's Conf directory and open it for editing.

  5. Locate the Server,shutdown line and change the value of port to "1" as shown in:

  6. Locate the connector port line and modify the port value to "${port.http}"

  7. Comment out the HTTPS,AJP segment:

  8. Open the current directory under Web. XML, set <listings> parameter to true:

  9. Open the Context.xml file in the current directory and set the context's reloadable parameter to "true":

  10. Save and exit, and then use the FTP tool to upload all Tomcat files to the root directory in the bin directory, as shown in:

  11. Finally we need to create our own customized Web. config file, open your editor, paste the contents of my Web. config file below, if your JDK, Tomcat is different, modify the relevant path, You can also download directly from my github:

    Https://github.com/kingliantop/azurelabs/blob/master/Java/websites/indepth/web.config

    1 <?XML version= "1.0" encoding= "UTF-8"?>2 3 <Configuration>4 5 <system.webserver>6 7 <handlers>8 9 <Addname= "Httpplatformhandler"Path="*"verb="*"Modules= "Httpplatformhandler"ResourceType= "Unspecified" />Ten  One </handlers> A  - <HttpplatformProcesspath= "%home%\site\wwwroot\bin\apache-tomcat-8.0.32\bin\startup.bat" -  the arguments=""> -  - <Environmentvariables> -  + <environmentvariablename= "Catalina_opts"value= "-dport.http=%http_platform_port%" /> -  + <environmentvariablename= "Catalina_home"value= "%home%\site\wwwroot\bin\apache-tomcat-8.0.32" /> A  at <environmentvariablename= "Jre_home"value= "%home%\site\wwwroot\bin\jdk1.8.0_60" /> <environmentvariablename= "Java_opts"value= "-djava.net.preferipv4stack=true-dsun.java2d.d3d=false-xms512m-xmx1024m-xx:permsize=128m-xx:maxpermsize= 256m " /> -  - </Environmentvariables> -  - </Httpplatform> -  in </system.webserver> -  to </Configuration>

  12. The final step is to Web. config the file is uploaded to your Web root directory of the site:

  13. This time the Tomcat server will restart,thePAAS Environment will be redeployed, about 1 minutes or so, open your website site, you will see:

    prove yours. website site has indeed started to use your own Tomcat 8.0 as a container, but why is the page not displayed before we can see Heap Size page? This is because after you have deployed your own Tomcat , the working directory becomes the webapps directory under your Tomcat 8 .

  14. open ftp tool to tomcat 8 Span style= "font-family: the song Body;" > webapps directory root

     

  15. Turn on your Web Site Home page, you can see the show is already the one we modified before index.jsp page, as you can see from the page, Java We use the custom- made Java 8 , while Tomcat is our custom- made Tomcat 8 , the depth of customization takes effect:

Customizing the Azure Site Java Runtime Environment (4)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.