Sometimes if you have MaxPostSize set in Apache configuration(httpd.conf) to lower number such as 2048 bytes, you may get into error 413 when you perform operations such as file upload, data transfer from the browser. I had this issue for some of my applications deployed in weblogic server 10.3 with Apache proxying the requests.
You might want either increase the size or remove it completely. if you don't mention it will take default integer which is -1. this means unlimited size.
<Location /app1>
SetHandler weblogic-handler
WebLogicHost localhost
WebLogicPort 7001
WLCookieName cookie1
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/proxy.log
</Location>
Useful links:
If you would like to know how to integrate Apache with Weblogic, please visit this blog.
Showing posts with label Apache Weblogic Integration. Show all posts
Showing posts with label Apache Weblogic Integration. Show all posts
Configure Apache with multiple weblogic server instances
I came across a unique situation at work where I needed to configure Apache web server to forward requests to multiple weblogic server instances running on same box but different port numbers. Here is the scenario:
Instance A - http://test_server:7001/App1(Domain I)
Instance B - http://test_server:7003/App2 (Domain II)
Instance C - http://test_server:7005/App3 (Domain III)
I have App1 deployed on instance1 which is running in domain I. Similarly App2 deployed on instance 2, app3 deployed on instance 3. Needless to say all domains running in different ports(non-clustered environment).
Now I would like to configure my Apache to forward request to respective URLs based on what do they type in the URL.
If they type http://test_server/App1 should go to instance A.
If they type http://test_server/App2 should go to instance B.
If they type http://test_server/App3 should go to instance C.
When I use <IfModule> tag with location combination it did not work for me. But when I use <Location> tag for each app/instance in httpd.conf, it worked. Hope this information helps.
#### for Instance 1/App1
<Location /App1>
SetHandler weblogic-handler
WebLogicHost test_server
WebLogicPort 7001
WLCookieName cookie1
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/httpd_proxy1.log
</Location>
#### for Instance2/App2
<Location /App2>
SetHandler weblogic-handler
WebLogicHost test_server
WebLogicPort 7003
WLCookieName cookie2
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/httpd_proxy1.log
</Location>
#### for Instance3/App3
<Location /App3>
SetHandler weblogic-handler
WebLogicHost test_server
WebLogicPort 7005
WLCookieName cookie3
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/httpd_proxy1.log
</Location>
Instance A - http://test_server:7001/App1(Domain I)
Instance B - http://test_server:7003/App2 (Domain II)
Instance C - http://test_server:7005/App3 (Domain III)
I have App1 deployed on instance1 which is running in domain I. Similarly App2 deployed on instance 2, app3 deployed on instance 3. Needless to say all domains running in different ports(non-clustered environment).
Now I would like to configure my Apache to forward request to respective URLs based on what do they type in the URL.
If they type http://test_server/App1 should go to instance A.
If they type http://test_server/App2 should go to instance B.
If they type http://test_server/App3 should go to instance C.
When I use <IfModule> tag with location combination it did not work for me. But when I use <Location> tag for each app/instance in httpd.conf, it worked. Hope this information helps.
#### for Instance 1/App1
<Location /App1>
SetHandler weblogic-handler
WebLogicHost test_server
WebLogicPort 7001
WLCookieName cookie1
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/httpd_proxy1.log
</Location>
#### for Instance2/App2
<Location /App2>
SetHandler weblogic-handler
WebLogicHost test_server
WebLogicPort 7003
WLCookieName cookie2
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/httpd_proxy1.log
</Location>
#### for Instance3/App3
<Location /App3>
SetHandler weblogic-handler
WebLogicHost test_server
WebLogicPort 7005
WLCookieName cookie3
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/httpd_proxy1.log
</Location>
How to configure Apache plug-in with Weblogic10.3
Assume that you have downloaded and installed weblogic server. You want to install apache plug-in so that you can avoid port number when accessing the deployed applications.
The steps given below should work for apache 2.x.
Here we go:
1. Download the apache server plug in for weblogic from http://download.oracle.com/otn/bea/weblogic/server103/WLSWebServerPlugins1.0.1150354-Apache.zip
2. Extract the zip file into your hard disk.
3. Make sure you have necessary modules in the extracted zip folder.
For eg: mod_wl_220.so under windows folder
4. Verify that plug-in mod_so.c is enabled by typing the following command.
$APACHE_HOME \bin\apachetl –l (Unix/linux)
Or
$APACHE_HOME \bin\httpd –l (windows)
Where APACHE_HOME is the directory containing your Apache HTTP Server installation.
This lists all enabled modules. If mod_so.c is not listed, you must rebuild apache server to have it enabled.
5. Install the Apache HTTP Server Plug-In module for Apache 2.0.x by copying the mod_wl_22.so file to the $APACHE_HOME\modules directory.
6. Add the following line to your APACHE_HOME/conf/httpd.conf file manually:
LoadModule weblogic_module modules/mod_wl_22.so
7. Modify the ServerName as your machine ip address.
8. Add the following lines:
<IfModule mod_weblogic.c>
WebLogicHost ip_address
WebLogicPort 7001
MatchExpression *.jsp
Debug ALL
DebugConfigInfo On
KeepAliveEnabled ON
KeepAliveSecs 15
</IfModule>
<Location /web-app_name>
SetHandler weblogic-handler
</Location>
10. Verify the syntax of the httpd.conf file with the following command:
$APACHE_HOME\bin\apachectl -t
The output of this command reports any errors in your httpd.conf file or returns:
Syntax OK
11. Re-start Apache server.
12. Test everything by hitting the URL below in the browser:
http://servername/application_name/
P.S:
Hope the above information helps. If you have a requirement of configuring Apache with multiple weblogic server instances running in same box (non-clustered environment) with different port numbers, please follow this blog entry for the steps.
Please feel free to ask me if you have any questions.
The steps given below should work for apache 2.x.
Here we go:
1. Download the apache server plug in for weblogic from http://download.oracle.com/otn/bea/weblogic/server103/WLSWebServerPlugins1.0.1150354-Apache.zip
2. Extract the zip file into your hard disk.
3. Make sure you have necessary modules in the extracted zip folder.
For eg: mod_wl_220.so under windows folder
4. Verify that plug-in mod_so.c is enabled by typing the following command.
$APACHE_HOME \bin\apachetl –l (Unix/linux)
Or
$APACHE_HOME \bin\httpd –l (windows)
Where APACHE_HOME is the directory containing your Apache HTTP Server installation.
This lists all enabled modules. If mod_so.c is not listed, you must rebuild apache server to have it enabled.
5. Install the Apache HTTP Server Plug-In module for Apache 2.0.x by copying the mod_wl_22.so file to the $APACHE_HOME\modules directory.
6. Add the following line to your APACHE_HOME/conf/httpd.conf file manually:
LoadModule weblogic_module modules/mod_wl_22.so
7. Modify the ServerName as your machine ip address.
8. Add the following lines:
<IfModule mod_weblogic.c>
WebLogicHost ip_address
WebLogicPort 7001
MatchExpression *.jsp
Debug ALL
DebugConfigInfo On
KeepAliveEnabled ON
KeepAliveSecs 15
</IfModule>
<Location /web-app_name>
SetHandler weblogic-handler
</Location>
10. Verify the syntax of the httpd.conf file with the following command:
$APACHE_HOME\bin\apachectl -t
The output of this command reports any errors in your httpd.conf file or returns:
Syntax OK
11. Re-start Apache server.
12. Test everything by hitting the URL below in the browser:
http://servername/application_name/
P.S:
Hope the above information helps. If you have a requirement of configuring Apache with multiple weblogic server instances running in same box (non-clustered environment) with different port numbers, please follow this blog entry for the steps.
Please feel free to ask me if you have any questions.
Subscribe to:
Posts (Atom)
