Apache + WebLogic Virtual Host Configuration

xiaoxiao2021-03-06  41

From: http://blog.yesky.com/blog/eliujj/archive/2005/02/03/71026.html Apache WebLogic Virtual Host Configuring the overall environment Redhat AS3 WebLogic Server 8.1 SP2 (/ home / bea) Apache 2.0. 46 (/ usr / local / apache2)

Configuration target

Implement two domain names www.test1.com and www.test2.com can run JSP and Servlet applications simultaneously on one server

Implement www.test1.com and its secondary domain name (such as blog.test1.com) running JSP and Servlet applications on the same server

Note: www.test1.com directory in / home / test1 www.test2.com directory in / home / test2 blog.test.com directory to / home / test1 / blog (image resource catalog in Blog call is located in / home / test1 / Resource) www.test1.com, www.test2.com and blog.test1.com are parsed to the same IP address

First configure www.test1.com in WebLogic Web Application Test1 Now I will enter www.test1.com:7001 should be able to access Test1

Then configure WebLogic virtual host

In the left navigation bar of Console, select Mydomain -> Services-> VirtualHosts, then click Configure a New Virtual Host ... on the right ..., under the Configuration's General tab, fill in: name: Test2 Virtual Host Names: www.test2 .com then click "Apply", then go to the Target and Deploy tab, select MyServer, click "Apply", so that the virtual host named Test1 is successful. A virtual host Names: blog.test1.com

Then deploy two applications, respectively: TEST2 and Blog

Deploy Test2 to a virtual host www.test2.com to deploy blog to a virtual host blog.test1.com Restart WebLogic Server Now you can access http://www.test2.com: 7001/ and http: //blog.test1. COM: 7001 / Access should be the directory below www.test1.com

No urgent, change the config.xml file

Open the current WebLogic Server's config.xml file, find the VirtualHost configuration section, modify the part of the virtual host to the following code

That is, add a defaultwebapp = "in each virtual host configuration, and fill in the name of the corresponding web application).

After changing the configuration file, restart the WebLogic server. Visit http://www.test2.com: 7001/ and http://blog.test1.com: 7001/ should now see the default web page below the test2 and blog directory, respectively.

Combine Apache with WebLogic

Copy the mod_wl_20.so file under the / home / belie / weblogic81 / server / lib / linux / i686 directory to / usr / local / apache2 / modules directory

Open apache's httpd.conf file Add the following code:

LoadModule WebLogic_Module Modules / Mod_wl_20.so

# Weblogic Module WebLogichost 127.0.0.1 WebLogicPort 7001 Matchexpression * .jsp (here you can add some servlets you call, for example: matChexpression / test *, where Test is the prefix of all servlets, of course, it also involves To procedural standardization)

In order to enable Apache to support SSI, you have to open two modules

LOADMODULE INCLUDE_MODULE MODULES / MOD_INCLUDE.SO LOADMODULE CGI_MODULE MODULES / MOD_CGI.SO

Then open the following two sentences

AddType text / html .shtml addoutputfilter incrudes .shtml (wants what file supports SSI, just add it here, if you join .html, HTML can also support SSI)

Then change the default directory of the website to / home / test1 as follows ServerName www.test1.com

DocumentRoot "/ home / test1 /"

Options Indexes Followsymlinks Includes (this makes web page support SSI) Allowoverride None Order Allow, Deny Allow from All

Then perform the settings of the virtual host:

# Default Web Directory NameVirtualHost * ServerName www.test1.com serveradmin Webmaster@test1.com DocumentRoot / Home / Test1

# Test2 ServerAdmin webmaster@test2.com DocumentRoot / home / test2 ServerName www.test2.com WebLogicHost www.test2.com WebLogicPort 7001 MatchExpression * .jsp (here together with their own calls Some servlets, such as matchexpression / test *, where TEST is the prefix of all servlets, of course, it also involves the normalization of the program) Options INDES FOLLOWSYMLINKS INCLUDES ALLOWOVERRIDE NONE ORLOW , Deny Allow from All ORDER DENY, Allow Deny from all #blog serveradmin webmaster@test1.com DocumentRoot / home / test1 ServerName blog.test1.com WebLogicHost blog.test1.com WebLogicPort 7001 MatchExpression * .jsp (here are some servlet can be together with their own call, for example: MatchExpression / Test *, which Test For all servlet prefix, of course, it also involves the normalization of procedures) Options INDES FROMLINKS InCludes Allowoverride None ORDER ALLOW, DENY Allow from All < Directory "/ home / te ST1 / Blog / Web-INF / "> Order Deny, Allow Deny from all

Departure, exit Apache

Now passing www.test1.com, www.test2.com and blog.test1.com, you can access the web pages below the respective directories, respectively.

However, there is a problem that the BLOG call is located in the / home / test1 / resource directory, what is the displayed picture, it doesn't matter, we don't have a soft link.

LN -S / Home / Test1 / Resource / Home / Test1 / Blog / Resource

After the configuration is complete, now www.test1.com, www.test2.com and blog.test1.com can explain JSP and Servlet.

转载请注明原文地址:https://www.9cbs.com/read-60787.html

New Post(0)