previously described configuring the Tomcat service: http://1015489314.blog.51cto.com/8637744/1696388
Let's introduce the resin service. The resin service is similar to the Tomcat service and is a program that can be used to parse JSPs. Of course the resin service also requires JDK support, so before installing resin, refer to the installation and configuration of the JDK before configuring the Tomcat service, which is not described here.
First, install the resin
go to resin website to download the appropriate version: http://caucho.com/
Resin There are two versions, one is free, one is charged, we test on the virtual machine, only with free is enough.
1. Download
[Email protected] ~]# cd/usr/local/src/
[Email protected] src]# wget http://caucho.com/download/resin-4.0.45.tar.gz
2. Decompression
[Email protected] src]# TAR-ZXVF resin-4.0.45.tar.gz
3. Compiling
[Email protected] src]# CD resin-4.0.45
[Email protected] resin-4.0.45]#/configure--prefix=/usr/local/resin--with-java=/usr/local/jdk1.8.0_60/
4. Installation
[[email protected] resin-4.0.45]# make
[[email protected] resin-4.0.45]# make install
5. Start resin
[[email protected] resin-4.0.45]# service resin start
Note : Because resin listens on a port of 8080, and our previously defined Tomcat listening port is also 8080, shut down the Tomcat service before booting.
To see if the resin service is started:
[email protected] resin-4.0.45]# PS aux|grep resin
Then we can enter 192.168.0.109:8080 into Resin's homepage on the browser. (Remember to turn off the firewall)
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/73/72/wKioL1X-kn2z_6jPAAEHKIpXG_A452.jpg "title=" Qq20150920185231.jpg "alt=" Wkiol1x-kn2z_6jpaaehkipxg_a452.jpg "/>
Second, the configuration resin
1. Configure the Access port
The resin service listens to port 8080 by default, and if you want to change to 80 port, you need to modify the resin.properties file.
[Email protected] resin-4.0.45]# cd/usr/local/resin/conf/
[Email protected] conf]# vim resin.properties//
Found it
app.http:8080
Switch
App.http:80
Restart Resin Service
[Email protected] conf]# service resin restart
Then we enter 192.168.0.109 on the browser to directly access the Resin home page.
2. Configure a new virtual host
If you want to add a new virtual host, you need to modify the Resin.xml file
[[email protected] conf]# VIM resin.xml//Add the following to <cluster id= "app" >
<web-app id= "/" root-directory= "/data/resin"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/73/74/wKiom1X-lZOSVRumAADEWls1owE233.jpg "title=" Qq20150920191355.jpg "alt=" Wkiom1x-lzosvrumaadewls1owe233.jpg "/>
Create a directory where Web site files reside
[Email protected] conf]# mkdir-p/data/resin
Restart Resin Service
[Email protected] conf]# service resin restart
3. Test resin
Testing the resin is the same as testing the Tomcat step. Create a test file for Tomcat first:
[Email protected] conf]# vim/data/resin/111.jsp//Add the following:
<body>
<center>
Now time is: <%=new java.util.Date ()%>
</center>
</body>
After saving, use the Curl test:
[[email protected] conf]# curl-xlocalhost:80 www.123.com/111.jsp//operation results are as follows
<body>
<center>
Now time is: Mon Sep 00:42:47 CST
</center>
</body>
Alternatively, you can use the browser to test:
Locate the Hosts file under native C:\Windows\System32\drivers\etc, and add the following
192.168.0.109 www.123.com
Enter: www.123.com/111jsp, shown in the browser address bar, indicating that the resin was built successfully.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/73/74/wKiom1X-lw7Ss09eAACERKWKtHo281.jpg "title=" Qq20150920192226.jpg "alt=" Wkiom1x-lw7ss09eaacerkwktho281.jpg "/>
This article is from the "M April Days" blog, please be sure to keep this source http://1015489314.blog.51cto.com/8637744/1696548
Configuring the Resin Service