1. installation and configuration of resin in Windows
1
, Installation
1) install JDK
2. Decompress resin-3.0.x.zip
3) Run resin-3.0.x/httpd.exe
4) Open http: // localhost: 8080 to view the test page.
If it is opened correctly, the window displays the following information:
C:/win32> resin-3.0.0/bin/httpd
Resin 3.0.0-beta (built Thu Feb 13 18:21:13 PST 2003)
Copyright (c) 1998-2002 Caucho Technology. All rights reserved.
Starting Resin on Sat, 01 Mar 2003 19:11:52-0500 (EST)
[19:11:56. 479] ServletServer [] starting
[19:11:57. 000] Host [] starting
[19:11:58. 312] Application [http: // localhost: 8080/doc] starting
[19:12:11. 872] Application [http: // localhost: 8080/quercus] starting
...
[19:12:12. 803] http listening to *: 8080
[19:12:12. 933] hmux listening to *: 6802
2. Configuration
Services deployed in Windows:
The Resin Web Server can be installed as an Windows service.
The Resin server can be installed as a Windows service.
To install a Windows Service, run the following command:
C:/> resin-3.0.x/bin/httpd-install-conf CONF/myconf. conf
In this way, resin is automatically enabled as the service starts with the machine.
To remove this service
Resin-3.0.x/bin/httpd-Remove
You can also use the following command to enable or disable the resin service:
C:/> Net start Resin
...
C:/> net stop Resin
Multi-Service Startup Configuration:
Use the-install-as Foo parameter to specify a specific service name.
C:/> resin-3.0.x/bin/httpd-install-as Resina-conf CONF/myconf. conf
-Server
C:/> Net start Resina
Note:
There are some bugs in JDK. When the Administrator account is logged out, the Service will also be closed. The solution is to use the parameter-xrs during installation:
C:/> resin3.0.0/httpd.exe-install-xrs
Ii. installation and configuration of resin in Linux:
1. Installation
1) install JDK 1.4
2) Make sure that the environment variable java_home is correctly set.
3) Installation
Run separately:
# Tar zxvf resin-3.0.4.tar.gz
# Mv resin03.0.6/usr/local/resin
# Cd/usr/local/resin
#./Configure
# Make
# Make install
# Cd Bin
#./Httpd. Sh start
Automatic Start:
Add the following statement to/etc/rc. d/rc. Local:
/Usr/local/resin/bin/httpd. Sh start
Integration with Apache:
1) install Apache
# Tar zxvf httpd-2.49.tar.gz
# Cd httpd-2.49
#./Configure -- prefix =/usr/local/httpd -- enable-modules = so -- enable-so
-- Prefix
-- Enable-modules is used to specify the type of function extension modules allowed by the system. Here, it is specified as the So type.
-- Enabel-so is used to specify that dso (Dynamic Share Object Dynamic sharing object) is allowed ).
# Make
# Make install
Set Apache to start automatically:
Write Apache Startup File apachectl to RC. Local
/Usr/local/httpd/bin/apachectl start
2) resin Installation
# Tar zxvf resin-3.0.4.tar.gz
# Cd resin-3.0.4
#./Configure -- prefix =/usr/local/resin -- with-apache =/usr/local/httpd
# Make
# Make install
At this time, the. so file for connecting Resin to Apache2 has been generated, and it exists with $ APACHE_HOMEe/modules/mod_caucho.so
The following statements are added to conf/httpd. conf:
LoadModule caucho_modules modules/mod_caucho.so
ResinConfigServer localhost 6802.
Start Resin and Apache respectively
Visit http: // hostname/caucho-status to view the Resin status page.
2. Configuration
1) single server configuration using resin in linux
Use the single-server solution. After installation is complete, configure the Resin of the resin. conf file and app_default.xml file. resin. in the conf file, you must configure the port number and Web application directory. The default homepage search sequence can be configured in app_default.xml. Because the original website uses multiple port configurations, a single server can only be used for testing a single site.
2) multi-server configuration using resin in linux and configuration for Automatic startup of multiple instances
Sometimes you need to run multiple servers to listen to multiple ports on the same IP address. In this case, you need to use a separate Resin server to run multiple instances, deploy multiple Web sites by listening to multiple ports.
There are two configuration methods:
Method 1:
This method uses the httpd. sh parameter for multiple times to specify the configuration file and the runtime pid file to run multiple instances.
The command line used is as follows:
$ RESIN_HOME/bin/httpd. sh-conf/resin1.conf-pid resin1.pid start
Explanation:
The-conf option is the configuration file used to select the server instance. Different ports and home directories are configured in this file.
-Pid process id and pid file used.
Start.
With the preceding command, you can manually open multiple server instances after creating multiple server configuration files.
Add these statements to/etc/rc. d/rc. local to enable automatic start upon startup.
Method 2:
This method uses the Chkconfig command to set the background mode for Automatic startup of multiple servers at different system running levels. And make them a service that can be managed in the graphic interface.
After setting the JAVA_HOME environment variable, unpack the RESIN to/home/resin and execute the compilation script.
# Tar zxf resin-version.tar.gz
# Mv resin-version/home/resin
# Cd/home/resin/
#./Configure
# Make
# Make install
Copy the $ RESIN_HOME/contrib/init. resin generated by make install to the/etc/rc. d/init. d/directory and change it to resinx.
Modify the content of the resin file (3)
(1) JAVA environment settings
Find the following code snippet
JAVA_HOME =/usr/java
RESIN_HOME =/usr/local/resin
And change them to the corresponding directory. The first is the JDK installation main directory, and the second is the Resin security to the main directory.
(2) PID = $ RESIN_HOME/resin. pid
Change
PID = $ RESIN_HOME/resin1.pid (very clear, different pid)
(3) Find the program segment
Start)
Echo-n "Starting resin :"
If test-n "$ USER"; then
Su $ USER-c "$ EXE-pid $ PID start $ ARGS"
Else
$ EXE-pid $ PID start $ ARGS
Fi
Echo
;;
Change
Start)
Echo-n "Starting resin :"
If test-n "$ USER"; then
Su $ USER-c "$ EXE-conf $ RESIN_HOME/conf/resin1.conf-pid $ PID start $ ARGS"
Else
$ EXE-conf $ RESIN_HOME/conf/resin1.conf-pid $ PID start $ ARGS
Fi
Echo
;;
In fact, the above program is the same as the first part, but it runs with a script.
Last chmod + x resin1
Copy resin2, resin3 .....
Chmod + x resin1
Chmod + x resin2
......
Command:
CP contrib/init. Resin/etc/rc. d/init. d/resin1
VI/etc/rc. d/init. d/resin1
I
: WQ
Chmod + x/etc/rc. d/init. d/resin1
So you want to run several server instances to create several such files (resinx)
Modify some settings in resin: java_home resin_home user, etc,
Set the resin service to self-start at different startup levels:
#/Sbin/chkconfig resin1 Reset
#/Sbin/chkconfig resin2 Reset
......
Create different configuration files
Note that each configuration file must be different from each other:
(1) Some port numbers of the srun (Server Load balancer configuration) must be different. You can use different IP addresses.
The following section of the original file:
<Cluster>
<Srun server-id = "" host = "127.0.0.1" port = "6802" type = "codeph" text = "/codeph"/>
</Cluster>
(2) The default main file directory should be set to different, otherwise it will lose the meaning of multiple instances, otherwise it is better to use load balancing to improve performance
<Web-app id = "/" document-directory = "webapps/ROOT"/>
(3) The port number of the server must be different.
<Http server-id = "" host = "*" port = "8080"/>
In this way, when the system is started, resin will run multiple instances in the background, and the effect is the same as that in the first step.