卖逼视频免费看片|狼人就干网中文字慕|成人av影院导航|人妻少妇精品无码专区二区妖婧|亚洲丝袜视频玖玖|一区二区免费中文|日本高清无码一区|国产91无码小说|国产黄片子视频91sese日韩|免费高清无码成人网站入口

apache2.2 tomcat6.0實戰(zhàn)

以下紅色皆為測試參數(shù),可自行定義:一,系統(tǒng)。 .............................................................................

以下紅色皆為測試參數(shù),可自行定義:

一,系統(tǒng)。 ........................................................................................................ 1

二,安裝軟件..................................................................................................... 1

三, 測試 . ......................................................................................................... 1

四,配置apache ................................................................................................. 2

五,配置tomcat ................................................................................................. 4

六,整合實戰(zhàn)。 ................................................................................................. 4

意事項及出現(xiàn)的問題:....................................................................................... 4

實戰(zhàn)設(shè)置: ........................................................................................................ 5

一,系統(tǒng)。

Window XP(2003)

二,安裝軟件(安裝路徑不要有空格) 。

1,appserv-win32-2.5.10.exe

安裝目錄:C:AppServ 端口80

安裝過程中需要指定服務(wù)器所在的DNS 域名、服務(wù)器DNS 名稱、管理員郵箱,以及服務(wù)器啟動參數(shù)。沒有域名可以指定DNS 域名和服務(wù)器DNS 名稱為localhost 。實際工作中,DNS 域名為所購域名的后半部分,服務(wù)器DNS 名稱即為所購域名。如果服務(wù)器沒有提供郵件服務(wù),管理員郵箱可以任意指定。

,2,JDK6

安裝目錄:C:Java 配置好相應(yīng)的環(huán)境變量(JA V A_HOME,PA TH ,CLASS_PATH ) ,3,Tomcat6

安裝目錄:C:Tomcat 6.0 端口為81

安裝中需要指定Tomcat 使用的端口號、服務(wù)器管理員登錄用戶名和密碼。前面的可以按照默認的來,用戶名和密碼要牢記。

三, 測試。

1,驗證JDK 安裝狀態(tài)

打開cmd 命令窗口,輸入java

2,開啟apache2.2服務(wù) http://127.0.0.1/

3,開啟tomcat 服務(wù)

,

四,配置apache (整個過程其實就是讓apache 的httpd.conf 文件調(diào)用mod_jk.conf,mod_jk.conf調(diào)用workers.properties ) 。

1,打開C:AppServApache2.2confhttpd.conf文件

在最后的LoadModule 行(安ctrl f查找LoadModule )下面加上

LoadModule jk_module modules/mod_jk.so

2,在配置文件的最下面加上

Include conf/mod_jk.conf

3,在C:AppServApache2.2modules文件夾下加上

mod_jk-apache-2.2.4.so (要和apache 版本相同,或則盡量選擇版本接近,這點很重要) 文件 并改名為mod_jk.so

4,在C:AppServApache2.2conf文件夾下加上

mod_jk.conf

(主要定義mod_jk模塊的位置以及mod_jk模塊的連接日志設(shè)置,還有定義worker.properties 文件的位置。)

文件 文件內(nèi)容如下:

JkWorkersFile C:AppServApache2.2confworkers.properties

JkLogFile C:AppServApache2.2logs/mod_jk.log

JkLogLevel info

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

JkOptions ForwardKeySize ForwardURICompat -ForwardDirectories

JkRequestLogFormat "w V T"

JkMount /*.PictureCheckCode s1

JkMount /servlet/* s1

JkMount /*.jsp s1

JkMount /*.action s1

5,在C:AppServApache2.2conf文件夾下加上

workers.properties

(定義worker 的參數(shù),主要是連接tomcat 主機的地址和端口信息。如果Tomcat 與apache 不在同一臺機器上,或者需要做多臺機器上tomcat 的負載均衡只需要更改workers.properties 文件中的相應(yīng)定義即可。)

文件 文件內(nèi)容如下:

worker.list= s1

worker.s1.port=8009

worker.s1.host=localhost

,

worker.s1.type=ajp13

worker.DLOG4J.type=lb

worker.retries=3

worker.DLOG4J.balanced_workers=s1

worker.DLOG4J.sticky_session=1

worker.status.type=status

6,修改Apache 的文檔主目錄。把DocumentRoot 和 節(jié)點上的值 修改為"E:wwwroot":

#

# DocumentRoot: The directory out of which you will serve your

# documents. By default, all requests are taken from this directory, but

# symbolic links and aliases may be used to point to other locations.

#

DocumentRoot "E:wwwroot"

#

# Possible values for the Options directive are "None", "All",

# or any combination of:

# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you.

#

# The Options directive is both complicated and important. Please see

# http://httpd.apache.org/docs/2.2/mod/core.html#options

# for more information.

#

Options Indexes FollowSymLinks MultiViews ExecCGI

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be "All", "None", or any combination of the keywords:

# Options FileInfo AuthConfig Limit

#

AllowOverride All

#

# Controls who can get stuff from this server.

#

Order allow,deny

Allow from all

,

7, 修改C:AppServApache2.2confhttpd.conf文件的配置:

DirectoryIndex index.html index.jsp index.php index.htm

五,配置tomcat 。

1,修改Tomcat 的文檔主目錄。打開C:Tomcat 6.0conf server.xml文件 把

unpackW ARs="true" autoDeploy="true"

xmlV alidation="false" xmlNamespaceAware="false">

六,整合實戰(zhàn)。

1,在 E:wwwroot下放入項目

2,重新啟動apache2.2和tomcat 服務(wù)器

3,測試項目

意事項及出現(xiàn)的問題:

端口號被占用

,

實戰(zhàn)設(shè)置:

參考:http://lamp.linux.gov.cn/Apache/ApacheMenu/index.html

1,重定向:httpd.conf 配置:

##########重定向########################################

#

# 第二種方法:

# RedirectMatch ^/$ http://127.0.0.1/finance/Main.action

#

##########重定向########################################

RewriteEngine on

RewriteRule ^/$ /finance/Main.action [R]

2,限制文件訪問:httpd.conf 配置:

#########禁止訪問finance 項目下的WEB-ING 文件夾下的文件##############

Order allow,deny

Deny from all

3,一般情況下,不應(yīng)該使用.htaccess 文件

禁用自動掃描.htaccess 文件,httpd.conf 配置:

#

# Possible values for the Options directive are "None", "All",

# or any combination of:

# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews #

# Note that "MultiViews" must be named *explicitly* --- "Options All"

# doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options

# for more information.

#

Options Indexes FollowSymLinks MultiViews ExecCGI

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be "All", "None", or any combination of the keywords:

,

# Options FileInfo AuthConfig Limit

#

AllowOverride None

#

# Controls who can get stuff from this server.

#

Order allow,deny

Allow from all

4,apache 網(wǎng)頁錯誤控制跳轉(zhuǎn),httpd.conf 配置:

#

# Customizable error responses come in three flavors:

# 1) plain text 2) local redirects 3) external redirects

#

# Some examples:

#ErrorDocument 500 "The server made a boo boo."

ErrorDocument 401 /401.html

ErrorDocument 404 /404.html

ErrorDocument 403 /403.html

ErrorDocument 503 /503.html

#ErrorDocument 404 "/cgi-bin/missing_handler.pl"

#ErrorDocument 402

5,tomcat 網(wǎng)頁錯誤控制跳轉(zhuǎn),C:tomcat6confweb.xml配置:

404

/404.html

403

/403.html

401

/401.html

503

/503.html

,

優(yōu)化參考:

1,TOMCA T apache 2000萬訪問量的實現(xiàn): http://www.360doc.com/content/09/1010/15/186523_7068797.shtml

2,修改tomcat 內(nèi)存大?。?http://edu.codepub.com/2010/0327/21418.php

3,tomcat 優(yōu)化配置:

4,apache tomcat

我是初學(xué)者!很需要經(jīng)驗指導(dǎo)和錯誤糾正等等學(xué)習,有的忘告知,大家一起學(xué)習進步?。。?郵箱:shangchenbs@qq.com

標簽: