1、首先上传安装文件并解压
用到的命令:
guzip httpd-.tar.gz
tar xvf httpd-2.2.14.tar
2、却换到httpd-2.2.4目录。Cd httpd-2.2.4
3、执行./configure –prefix /home/bea/apache
……………………………………………………………………
creating test/Makefile
config.status: creating docs/conf/httpd.conf
config.status: creating docs/conf/extra/httpd-autoindex.conf
config.status: creating docs/conf/extra/httpd-dav.conf
config.status: creating docs/conf/extra/httpd-default.conf
config.status: creating docs/conf/extra/httpd-info.conf
config.status: creating docs/conf/extra/httpd-languages.conf
config.status: creating docs/conf/extra/httpd-manual.conf
config.status: creating docs/conf/extra/httpd-mpm.conf
config.status: creating docs/conf/extra/httpd-multilang-errordoc.conf
config.status: creating docs/conf/extra/httpd-ssl.conf
config.status: creating docs/conf/extra/httpd-userdir.conf
config.status: creating docs/conf/extra/httpd-vhosts.conf
config.status: creating include/ap_config_layout.h
config.status: creating support/apxs
config.status: creating support/apachectl
config.status: creating support/dbmmanage
config.status: creating support/envvars-std
config.status: creating support/log_server_status
config.status: creating support/logresolve.pl
config.status: creating support/phf_abuse_log.cgi
config.status: creating support/split-logfile
config.status: creating build/rules.mk
config.status: creating build/pkg/pkginfo
config.status: creating build/config_vars.sh
config.status: creating include/ap_config_auto.h
config.status: executing default commands
[bea@mylinux httpd-2.2.14]$
4、编译环境
# make
5、安装apache
$ make install
6、查看是否安装成功。切换到/apche/apche/bin目录。执行。./httpd –version可看到如下信息:
[root@mylinux bin]# ./httpd -version
Server version: Apache/2.2.14 (Unix)
Server built: Mar 2 2010 13:12:38
7、切换到/apche/apche/conf目录编辑httpd.conf文件。在httpd.conf文件里添加:
Include conf/Weblogic.conf
<IfModule mod_weblogic.c>
LoadModule weblogic_module modules/mod_wl_22.so
<IfModule mod_weblogic.c>
8、上传Weblogic.conf到conf. Weblogic.conf文件内容为:
##### Weblogic.conf file
WebLogicHost 192.168.0.55 #adminserver地址
WebLogicPort 7001 #adminserver端口
MatchExpression *.jsp
MatchExpression /portal/*
MatchExpression /fortune/*
MatchExpression /ClosingTime/*
MatchExpression /ConfigItem/*
MatchExpression *.html
MatchExpression *.jpg
MatchExpression *.gif
MatchExpression *.css
MatchExpression *.do
WLLogFile /tmp/wlproxy.log
9、切换到/apche/apche/bin目录执行./httpd –t
# ./httpd -t
httpd: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.55 for ServerName
Syntax OK
报错的话,请在http.conf里添加ServerName 192.168.0.55:80
修改后:
[root@mylinux bin]# ./httpd -t
Syntax OK
启动和关闭Apache
安装完成后就可以启动Apache服务。Apache的启动关闭都是通过<Apache安装目录> /bin目录下的apachectl命令进行管理的。启动Apache服务,如下所示。
./apachectl start
关闭Apache服务,如下所示。
./apachectl stop
重启Apache服务,如下所示。
./apachectl restart
10、测试转发
(1)在http:// 192.168.0.55:7001/console中部署个web测试应用程序;
(2)切换到/apache/apache2 /bin 执行./httpd -k start
(3)测试部署在weblogic中的web测试应用程序是否能够正常使用。输入http://192.168.0.55:7001/welcome.jsp。如果可以打开如下的页面说明。说明部署成功;
(4)测试http请求是否可以通过apache转发到weblogic中。输入http://192.168.0.55/welcome.jsp。如果可以打开如下的页面,说明apache成功的做了转发。