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
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 /"
Then perform the settings of the virtual host:
# Default Web Directory NameVirtualHost *
# Test2
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.