In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to operate and manage the Tomcat server from the remote host, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.
We may hand over a lot of web applications to Tomcat, so the Tomcat server will have to manage our loaded web applications, so where can we enter the management platform of the Tomcat server? First of all, we start the Tomcat server, go to its home page, and find that you need to enter a password when you click on the three items "Server Status", "Manager App" and "Host Manager" on the right:
Need a password
So what is the user name and password?
It depends on the [tomcat-users.xml] file in the [conf] directory of Tomcat, which is designed to configure administrative users of Tomcat.
In this "tomcat-users.xml" file, there are comments like this (green font section):
The tag describes the role played by the user, which is a description of an attribute of the tag.
Instead, create an administrative user of the Tomcat server who can log in and access it without writing a user name and password, but this is not suitable for server security management.
So let's create a user with the user name: fjdinsd, password 123, and the role "guest" for the time being:
Note that every time you modify the "tomcat-users.xml" file, restart the Tomcat server!
So let's continue to visit, click "Manager App", and you need to enter a user name and password when it pops up:
You will find:
Yes, the visit is not available. Are you kidding me? )
This is because the creating user does not have administrative rights, so how can you have administrative rights? the example in the next line of the notes on the screenshot of the file in "tomcat-users.xml" at the beginning shows that if you want the user to have administrative rights, then the newly created user's role (the "roles" attribute) must have the attribute value of "manager-gui".
So add "manager-gui" to the "roles" attribute of the user I just created:
At this time, click "Manager App" again, re-enter the user name and password, and open the "door to a new world" (- _ -!):
In this, below the Applications column are the web applications under the [webapps] directory in the corresponding Tomcat directory, such as the web application I created: [myWebApp]:
There are "Start", "Stop", "Reload" and "Undeploy" commands on the command line. If we can access the server remotely, we can operate the web application through the server. For example, if we click "Undeploy", my web application will be deleted from the [webapps] directory.
The "WAR file to deploy" line allows war files to be transferred remotely to the Tomcat server, and the server places the received war files in its [webapps] directory, decompresses and runs them:
Next, my desktop will open the Tomcat server (192.168.1.101), and the notebook will war my web application and upload it to the Tomcat server. Finally, the laptop will access the web application that has just been uploaded.
The web application for my notebook is located in [fjweb], where there is only one "1.html file":
Package the web application with war:
Get the "fjweb.war" package:
Then log in to the Tomcat server on the notebook side, select "Manager App", enter the user name and password, find the item "WAR file to deploy", select the war file that has just been packaged, and click "Deploy" to send the file to the Tomcat server, and the Tomcat server can manage it automatically:
You can see the addition of "fjweb" to the newly uploaded web application on Application:
Then we can continue to access it from the laptop side.
However, there is a small problem. Judging from the directory where the server is located to the web application directory that has just been uploaded, it is not that Tomcat decompresses its war package into its original appearance, but that this directory has added another level:
Click in:
Our html page is under this second [fjweb] directory, so our access on the remote laptop side should enter the virtual directory path twice in the browser:
Thank you for reading this article carefully. I hope the article "how to operate and manage the Tomcat server from the remote host" shared by the editor will be helpful to everyone. At the same time, I also hope you can support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.