By csoto
on
Jul 19, 2011
A couple of weeks ago I saw a forum thread which I found very interesting. A guy was asking if it's possible or not to use WebLogic as a Web Server, in a similar way than when an index.html file is placed on the 'www' directory of Apache. So I answered him.
Actually you can use WebLogic as a web server, but unlike Apache where you place a html file to the www directory and you can see it immediately, in WebLogic you have to deploy it to a domain.
Actually you can use WebLogic as a web server, but unlike Apache where you place a html file to the www directory and you can see it immediately, in WebLogic you have to deploy it to a domain.
- The html files (or any other static content like pdf files) must be in a directory of your choice (i.e. C:\testhtml).
- On that directory create a WEB-INF directory (from the example of step 1 it would be C:\testhtml\WEB-INF).
- In the WEB-INF directory create a file called web.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE web-app PUBLIC"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN""http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"><web-app></web-app> - Login to the WebLogic Console to deploy the application (i.e. http://[your_server]:7001/console )
- Click on Deployments.
- Click Install and set the path to the directory of step 3 (if the directory only contains the html file and the WEB-INF subdirectory you will see no files to select, but the Next button will be enabled anyway).
- Leave default "Install this deployment as an application" and click Next.
- Select the servers you wish to deploy this.
- Accept the defaults and click Finish.
- Activate Changes if the message appears.
- You should now be able to see the application started in the deployments screen.
- You can now access your static content on the WebLogic Server port via the following URL: http://[your_server]:7001/testhtml/[your_static_file]
0 comments:
Post a Comment