By Leonard Price,2014-06-02 13:59
11 views 0

    说说说明;系redhat enterprise linux 5 update 2



    1. 搭建本地yum

     [root@tomcat ~]# mount /dev/cdrom /mntmount: block device /dev/cdrom is

    write-protected, mounting read-only[root@tomcat ~]# vi



    name=Red Hat Enterprise Linux 5

    Local Repository




    [root@tomcat ~]# yum install gcc

    [root@tomcat ~]# yum install


    2. 安装apache

     [root@tomcat ~]# cd /usr/local/src/[root@tomcat src]# ls

    apache-tomcat-6.0.18.tar.gz jdk-6u13-linux-i586.bin

    tomcat-connectors-1.2.28-src.tar.gzhttpd-2.2.11.tar.bz2 mysql-connector-java-


    [root@tomcat src]# tar jxvf httpd-2.2.11.tar.bz2[root@tomcat src]# cd httpd-2.2.11[root@tomcat httpd-2.2.11]#

    ./configure --prefix=/usr/local/httpd --with-mpm=worker --enable-cache

    --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-mime-


    --enable-headers --enable-ssl --enable-http --enable-cgi --enable-rewrite

    --enable-so --with-suexec-gidmin --with-suexec-logfile

    [root@tomcat httpd-2.2.11]#


    [root@tomcat httpd-2.2.11]#

    make install

    [root@tomcat httpd-2.2.11]#

    cp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/apache

    [root@tomcat httpd-2.2.11]#

    /etc/rc.d/init.d/apache start

    httpd: apr_sockaddr_info_get()

    failed for tomcat

    httpd: Could not reliably

    determine the server's fully qualified domain name, using for


    [root@tomcat httpd-2.2.11]#

    vi /usr/local/httpd/conf/httpd.confServerName localhost:80 说说说

    [root@tomcat httpd-2.2.11]#

    /etc/rc.d/init.d/apache stop

    [root@tomcat httpd-2.2.11]#

/etc/rc.d/init.d/apache start

    [root@tomcat httpd-2.2.11]#

    ps aux | grep httpd; netstat -ntulp | grep :80root 29285

    0.5 0.4 7420

    2476 ? Ss 17:20

    0:00 /usr/local/httpd/bin/httpd -k start

    daemon 29286

    0.0 0.3 7192

    1564 ? S 17:20

    0:00 /usr/local/httpd/bin/httpd -k start

    daemon 29287

    0.0 0.3 284056 1936 ?

    Sl 17:20 0:00 /usr/local/httpd/bin/httpd -k startdaemon 29289

    0.0 0.3 284056 1940 ?

    Sl 17:20 0:00 /usr/local/httpd/bin/httpd -k startdaemon 29291

    0.0 0.3 284056 1940 ?

    Sl 17:20

    0:00 /usr/local/httpd/bin/httpd -k start

    root 29372

    0.0 0.1 3904

    672 pts/0 R+

    17:20 0:00 grep httpd

    tcp 0

    0 :::80

    :::* LISTEN 29285/httpd 3.安装tomcat

    [root@tomcat httpd-2.2.11]#

    cd ..

    [root@tomcat src]# mv


    tomcat-connectors-1.2.28-src.tar.gz jdk-6u13-linux-i586.bin jaf-1_0_2- /opt

    [root@tomcat src]# cd /opt/

    [root@tomcat opt]# ls

    apache-tomcat-6.0.18.tar.gz jdk-

    6u13-linux-i586.bin tomcat-connectors-1.2.28-src.tar.gz[root@tomcat opt]# tar zxvf

    apache-tomcat-6.0.18.tar.gz ; unzip ; unzip ; tar zxvftomcat-connectors-1.2.28-src.tar.gz ;

    chmod +x jdk-6u13-linux-i586.bin

    [root@tomcat opt]# ls

    apache-tomcat-6.0.18 jaf-1.0.2 javamail-1.4.2 jdk-6u13-

    linux-i586.bin tomcat-connectors-1.2.28-src.tar.gzapache-tomcat-6.0.18.tar.gz tomcat-


    安装sun javaJDK

    [root@tomcat opt]#


    Sun Microsystems, Inc. Binary Code License






    file, the disclaimer of

    warranty and

    limitation of liability provisions inparagraphs 5 and 6

    of the Binary Code License Agreementshall apply to all

    Software in this distribution.

    H. Termination for

    Infringement. Either party may terminatethis Agreement

    immediately should any Software become, orin either party's

    opinion be likely to become, the subjectof a claim of

    infringement of any intellectual propertyright.

    I. Installation and

    Auto-Update. The Software's

    installation and

    auto-update processes transmit a limitedamount of data to

    Sun (or its service provider) about thosespecific processes

    to help Sun understand and optimizethem. Sun does not

    associate the data with personallyidentifiable

    information. You can find more informationabout the data Sun

    collects at inquiries please

    contact: Sun Microsystems, Inc., 4150Network Circle, Santa Clara, California95054, U.S.A.

    Do you agree to the

    above license terms? [yes or no]yes

    ~~~~~~~~~~~~~~~~~~~ignore~~~~~~~~~~~~~~~~~~~~~``Java(TM) SE

    Development Kit 6 successfully installed.Product Registration

    is FREE and includes many benefits:* Notification of

    new versions, patches, and updates* Special offers on

    Sun products, services and training* Access to early

    releases and documentation

Product and system

    data will be collected. If your configurationsupports a browser,

    the Sun Product Registration form forthe JDK will be

    presented. If you do not register, none ofthis information

    will be saved. You may also register yourJDK later by opening

    the register.html file (located in

    the JDK installation

    directory) in a browser.

    For more information

    on what data Registration collects andhow it is managed

    and used, see:

    Press Enter to



    [root@tomcat opt]# mv

    apache-tomcat-6.0.18 tomcat; mv jdk1.6.0_13 java;mv jaf-1.0.2 jaf; mv javamail-1.4.2 java[root@tomcat opt]# ls


    tomcat tomcat-connectors-1.2.28-src.tar.gz

    jaf java jdk-6u13-linux-i586.bin tomcat-



    [root@tomcat opt]# vi /etc/profile










    [root@tomcat opt]# source


    [root@tomcat opt]# cd


    [root@tomcat native]# ./configure


    --with-apxs=/usr/local/httpd/bin/apxs[root@tomcat native]# make


    [root@tomcat native]# cp

    apache-2.0/ /usr/local/httpd/lib/[root@tomcat native]#cd /opt

[root@tomcat opt]# vi


    LoadModule jk_module lib/ mod_jk settings

    Include conf/mod_jk.conf

    [root@tomcat opt]# cd


    [root@tomcat conf]# touch


    [root@tomcat conf]# vi mod_jk.conf#setup the filepath, default prefix path is httpd's home (/usr/local/httpd)

    JkWorkersFile conf/workers.propertiesJkLogFile /var/log/jk.log



    JkLogLevel error

    JkLogStampFormat "[%a %b %d%H:%M:%S %Y] "

    JkOptions +ForwardKeySize

    +ForwardURICompat -ForwardDirectoriesJkRequestLogFormat "%w %V


    # Sample JkMounts. Replace thesewith the paths you would

    # like to mount from your JSPserver.

    # syntax: JkMount ${URL_DIR}/*.jspworker_name

    JkMount /project1/*.jsp jsp-ap207JkMount /project2/*.jsp jsp-ap207JkMount /project3/*.jsp jsp-ap207[root@tomcat conf]# touch

    [root@tomcat conf]# vi

    # BEGIN

    # setting tomcat_home and


    workers.tomcat_home=/opt/tomcatworkers.java_home=/opt/java# worker.list defined worker_name,used by mod_jk.conf


    worker.jsp-ap207.port=8009[root@tomcat conf]# cd /opt/[root@tomcat opt]# vi





    reloadable="true" crossContext="true">[root@tomcat opt]# mkdir -p

    "/projects/project1"; cd /projects/project1

    [root@tomcat project1]#

    /etc/rc.d/init.d/apache stop[root@tomcat project1]#

    /etc/rc.d/init.d/apache start[root@tomcat project1]#


    Using CATALINA_BASE: /opt/tomcatUsing CATALINA_HOME: /opt/tomcatUsing CATALINA_TMPDIR:


    Using JRE_HOME: /opt/java说说

    [root@tomcat project1]# vi


    String str1="Hello




Report this document

For any questions or suggestions please email