JAVA/JSP Learning Series 3 (installation of Resin + Apache)

Source: Internet
Author: User

I. Preface

Tomcat is a good choice for beginners to execute JSP and Servlet. You can also use Resin. Both products do not cost a penny. Resin supports Xml well.

Ii. Download and install

For the Resin official site: http://www.caucho.com /.

Download from this address: http://www.caucho.com/download/index.xtp. the download is resin1.1.4133.

After downloading, decompress the package to a directory. Here I use E: \ resin114 as an example.

Iii. Configuration

Before that, of course, we have to install Apache and run it properly.

(1) Configure Apache

Open the httpd. conf file in the conf subdirectory of apache and edit it with a text editing tool. Add the following lines:

LoadModule caucho_module "E: \ resin114 \ srun/win32-1.3.6 \ mod_caucho.dll"

AddModule mod_caucho.c

<IfModule mod_caucho.c>

CauchoConfigFile "E: \ resin114 \ conf \ resin. conf"

<Location/caucho-status>

SetHandler caucho-status

</Location>

</IfModule>

Note: The preceding steps can also be implemented in a simpler way, that is, run setup.exe under E: \ resin114 \ bin \ directory, check apache, Apply, and finally OK. In this way, the above rows should be automatically added.

(2) Configure Resin

There is a resin. conf file under the conf sub-directory of resin, which is backed up by one. Create the resin. conf file as follows:

<Caucho.com>

<Http-server app-dir = 'e:/apache/htdocs '>

<Error-log id = 'Log/error. log'/>

<Classpath id = 'web-INF/classes 'source = 'web-INF/classes 'compile = 'true'/>

<Servlet-mapping url-pattern = '/servlets/* 'servlet-name = 'invoker'/>

<Servlet-mapping url-pattern = '*. xtp' servlet-name = 'com. caucho. jsp. XtpServlet '/>

<Servlet-mapping url-pattern = '*. jsp' servlet-name = 'com. caucho. jsp. JspServlet '/>

</Http-server>

</Caucho.com>

Iv. Test

(1) Start Resin:

There is a srun.exe under the resinbind, run it, and a window will appear.

(2) create a simple jsp file test. jsp (we use the resin site example)

This file is stored in: apache/htdocs/test. jsp

The content is as follows:

<% @ Page language = javascript %>

2 + 2 = <% = 2 + 2%>

(3) Run

Enter http: // localhost/test. jsp in the browser and the following result is displayed:

2 + 2 = 4

Now that you have successfully installed the file, you can create your own subdirectories under htdocs to manage files.

Note: In Step 4 (1), you can enable resin to add srunto win2000's service, so that srun.exe is automatically started every time the resinservice is started.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.