Introduction to jsvc In production, Tomcat should run in daemon mode, and if you need to start Tomcat as a normal user, you cannot use ports below 1024. This is a limitation of the Liunx system. Only the root user can use ports less than 1024. So how do you configure tomcat as a service? We can easily encapsulate our own startup scripts through jsvc, and we can also arbitrarily set the tomcat running user and group, and specify the jvm running parameters such as memory control, language, and character encoding. We can also specify the pidfile that tomcat starts with. In short, we can have more precise control over how tomcat runs. It has incomparable advantages over the original script. alright! After talking so much, I just want to explain in this article how to run it as a normal user. I haven’t learned the other things yet! Set the permissions for the Tomcat directory Create a tomcat user (by default, a tomcat group is also created) useradd tomcat Set the owner user of the tomcat directory to tomcat and the group to tomcat group chown -R tomcat:tomcat /usr/local/tomcat/ enter description here The tomcat root permission displayed at this time actually means that this soft link belongs to root. The tomcat directory we linked to is already owned by tomcat and -R recursively passes permissions. Open the read permission of all files under Tomcat to users in the group to avoid errors during startup. For example, the sever.xml file cannot be read Open writable permissions for the webapps, logs, work, and temp directories under Tomcat to users in the group Install jsvc I have already talked about deploying Java+Tomcat environment last time, this article is a follow-up to the last one. Attached is the previous article: https://www.jb51.net/article/160936.htm jsvc is bound to the tomcat binary distribution, finds the source code package, and is ready to compile into a binary file. Enter the bin directory under tomcat and find Unzip the source code package Enter the unzipped directory and compile The above error occurs because the gcc compilation environment is not installed Run it again and the following content will appear Compile After compilation is complete, a jsvc file will be generated in the current folder Copy it to the tomcat bin directory At this time we use daemon.sh to run our tomcat Other commands: Summarize The above is the introduction of using jsvc to start tomcat (run as a normal user). I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. Thank you very much for your support of the 123WORDPRESS.COM website! |
<<: MySQL case when group by example
>>: How to monitor array changes in Vue
There is another tree structure Javascript object...
Use CSS3 to achieve cool radar scanning pictures:...
1. Use the <a> tag to complete <a href=&...
This article shares the specific code of using ca...
Table of contents Problem Description Scenario In...
1. Experimental Environment serial number project...
CI/CD Overview CI workflow design Git code versio...
Only show the top border <table frame=above>...
Preface Generally speaking, when we talk about Li...
Table of contents 1. Enter a directory and create...
This article shares with you how to install the M...
Tomcat defines multiple ClassLoaders internally s...
Test the efficiency of deleting a large number of...
Page domain relationship: The main page a.html bel...
Brief Tutorial This is a CSS3 color progress bar ...