首页 > 代码库 > Linux apache tomcat
Linux apache tomcat
[root@node1 ~]# mv jdk-7u79-linux-x64.tar.gz /usr/local/
[root@node1 ~]# cd /usr/local/
[root@node1 local]# tar jxvf jdk-7u79-linux-x64.tar.gz
[root@node1 local]# cd jdk1.7.0_79/
[root@node1 jdk1.7.0_79]# pwd
/usr/local/jdk1.7.0_79
[root@node1 jdk1.7.0_79]# vim /etc/profile
JAVA_HOME=/usr/local/jdk1.7.0_79
JAVA_BIN=/usr/local/jdk1.7.0_79/bin
PATH=$PATH:$JAVA_BIN
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
[root@node1 jdk1.7.0_79]# source /etc/profile
[root@node1 jdk1.7.0_79]# java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
[root@node1 ~]# mv apache-tomcat-7.0.79.tar.gz /usr/local/
[root@node1 local]# tar zxvf apache-tomcat-7.0.79.tar.gz
[root@node1 local]# cd apache-tomcat-7.0.79
[root@node1 apache-tomcat-7.0.79]# cd bin/
[root@node1 bin]# vim catalina.sh
CATALINA_HOME=/usr/local/apache-tomcat-7.0.79
[root@node1 bin]# ./catalina.sh start
Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.79
Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.79
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.79/temp
Using JRE_HOME: /usr/local/jdk1.7.0_79
Using CLASSPATH: /usr/local/apache-tomcat-7.0.79/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.79/bin/tomcat-juli.jar
Tomcat started.
[root@node1 apache-tomcat-7.0.79]# cd logs/
[root@node1 logs]# ls
catalina.2017-07-08.log host-manager.2017-07-08.log localhost_access_log.2017-07-08.txt
catalina.out localhost.2017-07-08.log manager.2017-07-08.log
[root@node1 logs]# tail -f catalina.out
Jul 08, 2017 1:09:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/apache-tomcat-7.0.79/webapps/docs
Jul 08, 2017 1:09:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /usr/local/apache-tomcat-7.0.79/webapps/docs has finished in 185 ms
Jul 08, 2017 1:09:25 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 08, 2017 1:09:25 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 08, 2017 1:09:25 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5448 ms
[root@node1 ~]# tar zxvf apr-1.6.2.tar.gz
[root@node1 ~]# cd apr-1.6.2
[root@node1 apr-1.6.2]# mkdir /usr/local/apr
[root@node1 apr-1.6.2]# ./configure --prefix=/usr/local/apr/
[root@node1 apr-1.6.2]# make
[root@node1 apr-1.6.2]# make install
[root@node1 ~]# tar zxvf apr-util-1.6.0.tar.gz
[root@node1 ~]# cd apr-util-1.6.0
[root@node1 apr-util-1.6.0]# mkdir /usr/local/apr-util
[root@node1 apr-util-1.6.0]# ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr/bin/apr-1-config
[root@node1 apr-util-1.6.0]# make
[root@node1 apr-util-1.6.0]# make install
[root@node1 ~]# unzip pcre-8.41.zip
[root@node1 ~]# cd pcre-8.41
[root@node1 pcre-8.41]# mkdir /usr/local/pcre
[root@node1 pcre-8.41]# ./configure --prefix=/usr/local/pcre/ --with-apr=/usr/local/apr/bin/apr-1-config
[root@node1 pcre-8.41]# make
[root@node1 pcre-8.41]#make install
[root@node1 ~]# tar httpd-2.4.26.tar.gz
[root@node1 ~]# cd httpd-2.4.26
[root@node1 httpd-2.4.26]#./configure --prefix=/usr/local/apache --with-pcre=/usr/local/pcre/ --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/
[root@node1 httpd-2.4.26]# make
[root@node1 httpd-2.4.26]# make install
[root@node1 httpd-2.4.26]# vim /usr/local/apache/conf/httpd.conf
ServerName 192.168.183.129:80
[root@node1 logs]# /usr/local/apache/bin/apachectl start
Linux apache tomcat