JeE2y3wjhPs/Vg_StC3XrMI/AAAAAAAABSE/TCbS3PsTIvg/s800-Ic42/install-netbeans.png' alt='Installing Java Jdk On Centos Linux' title='Installing Java Jdk On Centos Linux' />Install Tomcat 6 on Cent. OS or RHEL David Ghedini. Install Tomcat 6 on Cent. OS or RHEL. This post will cover installation and configuration of Tomcat 6 on Cent. OS 5. We will also show how to run Tomcat as a service, create a startstop script, and configure Tomcat to run under a non root user. This post has been updated for Tomcat 6. This post below will work with any Tomcat 6. I have been keeping it updated to keep the links consistent and to make it as copying and paste as possible. If you are looking for our tutorial on installing Tomcat 7 on Cent. OSRHEL, you can find it here. This installation of Tomcat 6. Cent. OS 5. 5, but any Cent. OS 5. x should work, as well as RHEL and Fedora. If you do not already have the Java Development Kit JDK installed on your machine, you will need to download and install the required JDK for your platform. Yes, another one. Im installing NW702 EHP2 on Centos6. This was chosen by the customer, not me Its a version of RHEL6, with all proprietary code of any. SecurityEnhanced Linux SELinux is an implementation of security policies for operating systems that provides a mechanism to support and help control access in the. If you do have the JDK installed, you can skip to Step 2 Download and Install the Tomcat 6. Step 1 Install the JDKYou can download the JDK here http www. Im using the latest, which is JDK 6, update 2. The JDK is specific to 3. My Cent. OS box is 6. Ill need jdk 6u. If you are on 3. Download the appropriate JDK and save it to a directory. Im saving it to root. Move mv or copy cp the file to the opt directory rootblanche mv jdk 6u. Create a new directory usrjava. Change to the usrjava directory we created and install the JDK using sh optjdk 6u. Set the JAVAHOME path. This is where we installed our JDK above. To set it for your current session, you can issue the following from the CLI rootblanche java JAVAHOMEusrjavajdk. JAVAHOME. rootblanche java PATHJAVAHOMEbin PATH. PATH. To set the JAVAHOME for users, we add below to the user. We can also add it etcprofile and then source it to give to all users. JAVAHOMEusrjavajdk. JAVAHOME. PATHJAVAHOMEbin PATH. Once you have added the above to. Important. If you already have a version of DeployR installed, follow the migration instructions first. We highly recommend installing DeployR on a dedicated machine. Need to set up to use newer version of Java using alternatives. Use the following commands to do it. I like to be sure that everything will work just by copying the contents of the Java folder and setting the environment variables. I usually run the installer in a. Excellent tutorial on how to install an Apache Tomcat6 server on CentOS 5. Linux web server distribution. Installing Java Jdk On Centos Linux PdfJAVAHOME is set correctly. JAVAHOME. Step 2 Download and Install Tomcat 6. Download apache tomcat 6. Save the file to a directory. Im saving it to rootapache tomcat 6. Before proceeding, you should verify the MD5 Checksum for your Tomcat download or any other download. Since we saved the Tomcat download to rootapache tomcat 6. Compare the output above to the MD5 Checksum provided by the Apache Tomcat MD5 page and insure that they match exactly. There is also a link to display the MD5 checksum located just to the right off the download link. Now, move mv or copy cp the file to the usrshare directory rootblanche mv apache tomcat 6. Change to the usrshare directory and unpack the file using tar xzf rootblanche cd usrshare. This will create the directory usrshareapache tomcat 6. At this point, you could start Tomcat via the Tomcat bin directory using the Tomcat startup. Step 3 How to Run Tomcat as a Service. Baixar Livro De Engenharia Civil Gratis. We will now see how to run Tomcat as a service and create a simple StartStopRestart script, as well as to start Tomcat at boot. Change to the etcinit. Tomcat Start Stop Restart. JAVAHOMEusrjavajdk. JAVAHOME. PATHJAVAHOMEbin PATH. CATALINAHOMEusrshareapache tomcat 6. CATALINAHOMEbinstartup. CATALINAHOMEbinshutdown. CATALINAHOMEbinshutdown. CATALINAHOMEbinstartup. The above script is simple and contains all of the basic elements you will need to get going. As you can see, we are simply calling the startup. Tomcat bin directory usrshareapache tomcat 6. You can adjust your script according to your needs and, in subsequent posts, well look at additional examples. CATALINAHOME is the Tomcat home directory usrshareapache tomcat 6. Now, set the permissions for your script to make it executable rootblanche init. We now use the chkconfig utility to have Tomcat start at boot time. In my script above, I am using chkconfig 2. You can adjust as needed. Verify it rootblanche init. Now, lets test our script. Start Tomcat rootblanche service tomcat start. Using CATALINABASE usrshareapache tomcat 6. Using CATALINAHOME usrshareapache tomcat 6. Using CATALINATMPDIR usrshareapache tomcat 6. Using JREHOME usrjavajdk. Using CLASSPATH usrshareapache tomcat 6. Stop Tomcat rootblanche service tomcat stop. Using CATALINABASE usrshareapache tomcat 6. Using CATALINAHOME usrshareapache tomcat 6. Using CATALINATMPDIR usrshareapache tomcat 6. Using JREHOME usrjavajdk. Using CLASSPATH usrshareapache tomcat 6. Restarting Tomcat Must be started first rootblanche service tomcat restart. Using CATALINABASE usrshareapache tomcat 6. Using CATALINAHOME usrshareapache tomcat 6. Using CATALINATMPDIR usrshareapache tomcat 6. Using JREHOME usrjavajdk. Using CLASSPATH usrshareapache tomcat 6. Using CATALINABASE usrshareapache tomcat 6. Using CATALINAHOME usrshareapache tomcat 6. Using CATALINATMPDIR usrshareapache tomcat 6. Using JREHOME usrjavajdk. Using CLASSPATH usrshareapache tomcat 6. We should review the Catalina. We can now access the Tomcat Manager page at http yourdomain. IPaddress 8. 08. Tomcat home page. Step 5 Optional How to Run Tomcat using Minimally Privileged non root User. In our Tomcat configuration above, we are running Tomcat as Root. For security reasons, it is always best to run services with the only those privileges that are necessary. There are some who make a strong case that this is not required, but its always best to err on the side of caution. To run Tomcat as non root user, we need to do the following 1. Create the group tomcat rootblanche groupadd tomcat. Create the user tomcat and add this user to the tomcat group we created above. The above will create a home directory for the user tomcat in the default user home as hometomcat. If we want the home directory to be elsewhere, we simply specify so using the d switch. The above will create the user tomcats home directory as usrshareapache tomcat 6. Change ownership of the tomcat files to the user we created above rootblanche chown Rf tomcat. Note it is possible to enhance our security still further by making certain files and directory read only. This will not be covered in this post and care should be used when setting such permissions. Adjust the startstop service script we created above. In our new script, we need to su to the user tomcat binbash. Tomcat Start Stop Restart. JAVAHOMEusrjavajdk. JAVAHOME. PATHJAVAHOMEbin PATH. TOMCATHOMEusrshareapache tomcat 6. TOMCATHOMEstartup. TOMCATHOMEshutdown. TOMCATHOMEshutdown. TOMCATHOMEstartup. Step 6 Optional How to Run Tomcat on Port 8. Non Root User. Note the following applies when you are running Tomcat in stand alone mode. That is, you are running Tomcat without Apache in front of it. To run services below port 1. IP tables rootblanche iptables t nat A PREROUTING p tcp m tcp dport 8. REDIRECT to ports 8. A PREROUTING p udp m udp dport 8. REDIRECT to ports 8. Learn More About Apache Tomcat. Apache Tomcat Foundation. Tomcat 6. Posted at 0. AM Mar 0. 4, 2. 01. David in Tomcat . Comments1. 7. Tags tomcatcentos Export to.