Install Tomcat 6 on CentOS6
First, we need to download a tomcat installation package.
Http://ftp.riken.jp/net/apache/
Wget http://ftp.riken.jp/net/apache/tomcat/tomcat-6/v6.0.41/src/apache-tomcat-6.0.41.tar.gz
After downloading the package, decompress it to a directory. My files are stored in/usr/apache-tomcat-6.0.41.
Tar-zxvf apache-tomcat-6.0.41.tar.gz
Check whether tomcat has been started,
Netstat-apn | grep java
Tomcat seems to exist in Java in Linux, and I do not understand it very well.
Next we can go to the/conf directory to modify the corresponding configuration
First, modify server. xml.
Change the port to 8080
Next we are going to modify the configuration of the tomcat-user.xml, here we need to note that tomcat is disabled by default to close the Administrator account, but we can add to him, hey, simply add the following statement in it,
<Role rolename = "manager"/>
<Role rolename = "admin"/>
<User username = "root" password = "root" roles = "admin, manager"/>
Rolename is the role of the user.
Username is the user name.
Password is your password.
Just save and exit After configuring these settings.
Now let's start tomcat.
The startup tomcat file is startup. sh in the/bin directory.
Start directly./startup. sh and the following content will appear:
[Root @ yixian bin] #./startup. sh
Using CATALINA_BASE:/usr/apache-tomcat-6.0.41
Using CATALINA_HOME:/usr/apache-tomcat-6.0.41
Using CATALINA_TMPDIR:/usr/apache-tomcat-6.0.41/temp
Using JRE_HOME:/usr
Using CLASSPATH:/usr/apache-tomcat-6.0.41/bin/bootstrap. jar
This means the startup is successful.
Now let's look at it in the browser.
Localhost: 8080 or 127.0.0.1: 8080. You will be prompted to enter the user name and password, and enter the user name and password you set. Is it easy?
Then you can view the port.
[Root @ yixian bin] # netstat-apn | grep java
Tcp 0 0: 8080: * LISTEN 3027/java
Tcp 0 0: ffff: 127.0.0.1: 8005: * LISTEN 3027/java
Tcp 0 0: 8009: * LISTEN 3027/java
Unix 2 [] stream connected 50863 3027/java
We can see that tomcat on port 8080 has been started.
Stop tomcat or in the/bin directory
[Root @ yixian bin] #./shutdown. sh
Using CATALINA_BASE:/usr/apache-tomcat-6.0.41
Using CATALINA_HOME:/usr/apache-tomcat-6.0.41
Using CATALINA_TMPDIR:/usr/apache-tomcat-6.0.41/temp
Using JRE_HOME:/usr
Using CLASSPATH:/usr/apache-tomcat-6.0.41/bin/bootstrap. jar
Tomcat has stopped