resin installation quick start
You can start using Resin by simply expanding the archive, and
starting Resin with a Java command line.
Quick Start for the Impatient
The Resin web server starts listening to HTTP requests on
port 8080 and listens on port 6800
for load balancer
or cluster messages. Resin can then be
used for development or evaluation. The steps are:
- Install JDK 1.5 or later.
- On Unix, set the JAVA_HOME variable or
link /usr/java to the java home.
- On Windows, check to make sure the JDK
installation sets JAVA_HOME correctly.
- unzip/untar the Resin download. It will unzip into resin-3.1.x/.
- resin-3.1.x is resin.home, the location of the Resin distribution.
- For now, it is also resin.root, the location of your content.
Soon, you will want to move resin.root to
something like /var/www.
- On Unix, execute use ./configure; make; make install
- Start in development mode java -jar resin-3.1.x/lib/resin.jar
- Browse
http://localhost:8080
Adding Content
Once you've made sure Resin is working, you'll want to add some content
to the default web site:
- Add PHP files like resin-3.1.0/webapps/ROOT/hello.php.
- The URL in your browser will
be
http://localhost:8080/hello.php
- Add JSP files like resin-3.1.0/webapps/ROOT/hello.jsp.
- The URL in your browser will
be
http://localhost:8080/hello.jsp
- Add servlets like resin-3.1.0/webapps/ROOT/WEB-INF/classes/test/HelloServlet.java
-
Create a file resin-3.1.0/webapps/hello/WEB-INF/resin-web.xml to
configure the servlet.
- Add .war files like resin-3.1.0/webapps/hello.war.
- The URL in your browser is
http://localhost:8080/hello
- Create web-apps directly like
resin-3.1.0/webapps/hello/index.php
The URL in your browser is
http://localhost:8080/hello .
-
Create a file resin-3.1.0/webapps/hello/WEB-INF/resin-web.xml to
configure the 'hello' web application.
Virtual Hosts
You can easily create virtual hosts
by creating content in the resin.root/hosts directory:
- Add a hello.php to resin-3.1.0/hosts/localhost/webapps/ROOT/hello.php
Permanent content locations
Eventually, you'll want to move your content and configuration
into a more permanent location:
- Create a permanent resin.root:
- Create /var/www/webapps/ROOT/index.php
- Virtual hosts go in /var/www/hosts/www.foo.com/webapps/ROOT
- Run java -jar resin-3.1.0/lib/resin.jar --resin-root /var/www
- You can also set <root-directory> in the <cluster> to configure the resin root.
- If needed, modify the Resin configuration in resin-3.1.0/conf/resin.conf
- You can copy resin.conf to somewhere like /etc/resin/resin.conf
- Run java -jar resin-3.1.0/lib/resin.jar --conf /etc/resin/resin.conf
Running Resin as a daemon
In a deployment environment, Resin will run as a background daemon.
The previous steps ran Resin in the foreground, which is convenient
for development since the logging output goes to the console.
When running as a daemon, Resin detaches from the console and continues
running until told to stop.
- Start resin with java -jar resin-3.1.0/lib/resin.jar start
- Stop resin with java -jar resin-3.1.0/lib/resin.jar stop
- Restart resin with java -jar resin-3.1.0/lib/resin.jar restart
Until you're ready to deploy the server, those are all the
steps needed to get started with Resin.
Resin 3.1 needs Java before it can run. It needs JDK 1.5 or a later JDK.
Sun's JDK for Windows, Solaris, and Linux can be found at
http://java.sun.com. Sun also has
links to some other ports of the JDK.
The easiest and fastest Resin configuration uses the Resin as the primary or
only web server. This configuration provides a Java HTTP server. We recommend
you start with this before trying any other configuration.
The server listens at port 8080 in the default configuration and
can be changed to the HTTP port 80 during deployment.
Windows
- Install JDK 1.5 or later.
- Check that the environemnt variable JAVA_HOME is set to the JDK location, e.g. "c:\j2sdk1.5.0_01"
- Unzip resin-3.1.0.zip
- Define the environment variable RESIN_HOME to the location of
Resin, for example "c:\resin-3.1.0"
- Execute java -jar resin-3.1.0/lib/resin.jar
- Browse http://localhost:8080
Unix (including MacOS-X)
- Install JDK 1.5 or later and link /usr/java to the Java home or define the environment variable JAVA_HOME.
- tar -vzxf resin-3.1.0.tar.gz
- cd resin-3.1.0
- ./configure
- make
- make install
- Execute java -jar resin-3.1.0/lib/resin.jar
- Browse http://localhost:8080
For more details, see the Resin Web Server
configuration page.
If you are already using Apache for your web server, you can use Resin with
Apache. This configuration uses Apache to serve html, images, PHP, or Perl,
and Resin to serve JSPs and Servlets.
The Apache configuration uses two pieces: a C program extending
Apache (mod_caucho) and Java program supporting servlets and
JSP (srun.) The two pieces communicate with a special high-speed
protocol.
To configure Apache with Resin, you must
configure both Apache and Resin. The Resin
configuration is identical to Resin's httpd configuration. The Apache
configuration tells Apache how to find Resin.
- On Unix only, compile mod_caucho.so using
./configure --with-apache; make
- Make any needed Apache httpd.conf changes
- Make any needed Resin resin.conf changes
- Restart Apache
- Start Resin with
resin-3.1.0/bin/httpd.sh on Unix or
resin-3.1.0/httpd.exe on Windows.
On Unix, you'll run configure using --with-apache and then make :
unix> ./configure --with-apache=/usr/local/apache
unix> make
unix> make install
For more details, see the Resin with Apache
configuration page.
You can also combine IIS and Resin. IIS
serves static content like html and images and Resin serves JSPs and
Servlets. The IIS configuration requires two pieces:
isapi_srun.dll, an ISAPI extension which lets IIS talk to
Resin, and srun, Resin's Java support.
For this setup you must configure both IIS and Resin. The Resin
configuration is identical to Resin's httpd configuration. The IIS
configuration tells IIS how to find Resin.
- Setup the registry and IIS using resin-3.1.0/bin/setup
- Any needed Resin resin.conf changes
- Restart IIS
- Start Resin with resin-3.1.0/httpd.exe.
For more details and troubleshooting steps, see the
Resin with IIS configuration page.
Copyright © 1998-2015 Caucho Technology, Inc. All rights reserved. Resin ® is a registered trademark. Quercustm, and Hessiantm are trademarks of Caucho Technology.
Cloud-optimized Resin Server is a Java EE certified Java Application Server, and Web Server, and Distributed Cache Server (Memcached). Leading companies worldwide with demand for reliability and high performance web applications including SalesForce.com, CNET, DZone and many more are powered by Resin.
| home company docs app server |
|